I'm trying to get this simple program working:
Code: Select all
#include <ncurses.h>
int main()
{
initscr(); /* Start curses mode */
printw("Hello World !!!"); /* Print Hello World */
refresh(); /* Print it on to the real screen */
getch(); /* Wait for user input */
endwin(); /* End curses mode */
return 0;
}
libncurses5:amd64 install
libncurses5-dev install
libncursesw5:amd64 install
ncurses-base install
ncurses-bin install
ncurses-doc install
ncurses-term install
I compile like this:
gcc firstone.c -Wall -o firstone
And I get these errors:
/tmp/ccTeZP63.o: In function `main':
firstone.c:(.text+0x5): undefined reference to `initscr'
firstone.c:(.text+0x14): undefined reference to `printw'
firstone.c:(.text+0x1b): undefined reference to `stdscr'
firstone.c:(.text+0x23): undefined reference to `wrefresh'
firstone.c:(.text+0x2a): undefined reference to `stdscr'
firstone.c:(.text+0x32): undefined reference to `wgetch'
firstone.c:(.text+0x37): undefined reference to `endwin'
collect2: error: ld returned 1 exit status
What am I missing?