getch, getche, putch etc in gcc

I was using my college’s unix server (ubuntu presumably) to compile programs in the laboratory. Now, i have installed Opensuse 11.4 with gnome3. I have installed the Developers pattern, and almost all the packages that looked relevant (which came up when i searched for libgc , gcc, and all). Now, i cant compile a program:

/*program to test file I/O and getch/putch functionaliny in gcc*/
#include<stdio.h>
int main()
{       FILE *fi;
        char ch;
        char in;
        fi = fopen("infile","r");
        int countr=0,counterr=0;
        in='0';
        while(in!='
')
        {
                ch=fgetc(fi);
                if(ch=='
')
                        continue;
                else
                {
                        in=getch();

                        if(in==ch)
                        {
                                putch(in);
                                countr++;
                                counterr--;
                        }
                       else
                        {
                                counterr++;
                                continue;
                        }
                }
}    

I am a beginner in programming, so any free advice is also welcome.
Oh, the error is:

siddhartha@suse:~/Documents/programs> gcc typeprac.c
/tmp/ccQHPVwJ.o: In function `main':
typeprac.c:(.text+0x50): undefined reference to `getch'
typeprac.c:(.text+0x6c): undefined reference to `putch'
collect2: ld returned 1 exit status

Thank you.

To my knowledge putch and getch are MS DOS console functions in C (so they
do not exist on a linux system). I think you should use putchar and getchar
instead.
See


man getchar
man putchar

for explanations.


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.4 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.4 | nVidia
ION | 3GB Ram