Hi all,
Still trying to compile programs using ncurses and getting errors. I have two different versions of ncurses installed (according to rpm -qa | grep ncurses): libncurses5-5.9-12.5.1.i586 and libncurses6-5.9-12.5.1.i586 along with the version 5 devel package (ncurses-devel-5.9-12.5.1.i586)-don't know why there are two versions installed?
I am using a standard command line to compile:
Code:
g++ -g -Wall -lncurses program.cpp -o program
and I am getting the following errors:
/lib/libncurses.so.5: undefined reference to symbol 'stdscr'
note: 'stdscr' is defined in DSO /../libtinfo.so so try adding it to the linker command line
/../libtinfo.so: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
The c++ program is a simple ncurses 'hello world' program, don't know why I am getting the errors?
Code:
#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;
}
Thanks for any help.
No comments:
Post a Comment