Hi,
I have installed Code::Blocks 16.01 on my Gentoo linux system.
I am using gcc version 5.
I am new to C programming.
I just created a Console application project within Code::Blocks. I want to use ncurses library in it.
It contains so far only the main.c source file:
#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;
}
So when I want to build it, I get error messages:
-------------- Build: Debug in NcursesMenu01 (compiler: GNU GCC Compiler)---------------
g++ -o bin/Debug/NcursesMenu01 obj/Debug/main.o -lpthread -lX11 -lncurses
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: obj/Debug/main.o: undefined reference to symbol 'stdscr'
/lib64/libtinfo.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
I added in Project / Build options / Linker settings
followings:
pthread
X11
ncurses
both in Debug and in Release.
What should I do to solve this problem?