Trying to get getch() working to capture key press.
#include
...
...
WINDOW *w;
char f;
w = initscr();
timeout(30
The above answers are correct but the format is:
gcc -Wall program.c -o name_of_binary -lncurses
When I did:
gcc -Wall -lncurses program.c...
It did not work so apparently it should be tacked on the end.
That's a linking error. Are you linking to the curses library correctly?
There are two steps involved in using a library in C.
#include
the relevant header files from your source files. This is so your code knows what signatures of the library functions are. So you're doing this correctly.-lncurses
to the compile line should do it. Here's an explanation of linking.