Many systems deviate a little from the correct way...
The header is <curses.h>. There should not be systems now with headers ancient enough to have a difference between <curses.h> and <ncurses.h> — to the point that one should just be a hardlink to the other, assuming <ncurses.h> exists. SunOS tends to be weird, so if you are using SunOS you might have an unusual include path.
Likewise, as
salem c indicated, you need to link with the library.
Again, you may have to use pkg-config to find where it is, but if you used your package manager to install the ncurses library, it should be in one of the default search locations.
BTW, your code is incorrect: you are declaring the initscr() function, not calling it. Make sure to call it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#include <curses.h>
int main()
{
initscr();
// There are probably other things you would like to initialize here as well
// display output
printw( "Hello world!" );
refresh();
// don't terminate until a key is pressed
nodelay( stdscr, FALSE );
getch();
}
|
It is worth your time to Google the NCURSES-Programming-HOWTO.
Good luck!