Help In C

supravat paul supravatpaul_surya at yahoo.co.in
Sun Jul 5 14:00:04 BST 2009


Hello every one I'm using Ubuntu 9.04 Linux.... I'm facing some problem while compiling my C program:::

    

#include<stdio.h>
#include<stdlib.h>
#include<string.h>

intmain (intargc,char*argv[])	/* Main function */
{
    charcont;
    printf("Want
to enter new text? y/n: ");
    cont=getch();
    if(cont=='y')
    {
        printf("Enter
text for %s",argv[1]);
    }
    returnEXIT_SUCCESS;
}
while compiling this code with the help of following command 
$gcc -o q2 q2.c
it gives me the following error...

supravat at supravat-desktop:~/c/Done$ gcc -o q2 q2.c
/tmp/cc07EFXt.o: In function `main':
q2.c:(.text+0x42): undefined reference to `getch'
collect2: ld returned 1 exit status

This code runs successfully in Windows.... Please help me...


      Love Cricket? Check out live scores, photos, video highlights and more. Click here http://cricket.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-motu-mentors/attachments/20090705/73a40cea/attachment.htm 


More information about the Ubuntu-motu-mentors mailing list