[vox-tech] getch() c++ linux

Matin Hashemi matin.hashemi at gmail.com
Sun Jan 22 18:37:42 PST 2006


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


Matin


More information about the vox-tech mailing list