Unlike Python, using a library in C is a two step process.
Step 1) Add the appropriate "#include" statments to your source code.
Step 2) add the appropriate library names to the compiler command line.
You have the correct "#include" statments but the errror message suggests you havn't told the compiler to link with the library.
Typically you add a "-l" switch followed by the library name (like this -lncurses) to the gcc command.
Code: Select all
pi@Pi3:~ $ gcc -o nc nc.c
/tmp/ccQptShA.o: In function `main':
nc.c:(.text+0x18): undefined reference to `wgetch'
nc.c:(.text+0x24): undefined reference to `stdscr'
collect2: error: ld returned 1 exit status
pi@Pi3:~ $ gcc -o nc nc.c -lncurses