Matin Hashemi wrote:
> Anybody knows what's wrong with this code?
> 
> ***************************************
> #include <curses.h>
> #include <stdio.h>
> 
> int main() {
>         int c;
>         for(int i=0;;i++) {
>                 c = getch();
>                 printf("%d : %d\n",i,c);
>         }
> return 0;
> }
> ***************************************
> 
> I can't compile it with g++ 3.2.3 under Redhat Linux:
> 
> /tmp/cc2TgkPL.o(.text+0x1c): In function `main':
> : undefined reference to `stdscr'
> /tmp/cc2TgkPL.o(.text+0x21): In function `main':
> : undefined reference to `wgetch'
> collect2: ld returned 1 exit status

Be sure to link with the ncurses library using the -lncurses switch

-- 
I usually have a GPG digital signature included as an attachment.
See http://www.gnupg.org/ for info about these digital signatures.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
vox-tech mailing list
[email protected]
http://lists.lugod.org/mailman/listinfo/vox-tech

Reply via email to