Dec 13, 2012

openSUSE Forums: Can't compile ncurses program in Opensuse 12.2?

openSUSE Forums
openSUSE Forums
Can't compile ncurses program in Opensuse 12.2?
Dec 13th 2012, 18:55

Hi all,

For some reason if I try to compile a simple terminal program in c++ with ncurses in Opensuse 12.2, I keep getting errors?

I am using the command line:

Code:

g++ -g -Wall -lncurses ncurses.cpp -o ncurses
Here are the ncurses packages I have installed (found with rpm -qa > pkglist):

yast2-ncurses-pkg-2.22.7-2.1.2.i586
libncurses5-5.9-12.5.1.i586
ncurses-utils-5.9-12.5.1.i586
ncurses-devel-5.9-12.5.1.i586
libncurses6-5.9-12.5.1.i586
yast2-ncurses-2.22.4-1.1.2.i586


Here is the small program I want to compile as a test of ncurses working:

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;
}

Here are the errors:

/usr/lib/gcc/i586-suse-linux/4.7/../../../../i586-suse-linux/bin/ld: /lib/libncurses.so.5: undefined reference to symbol 'stdscr'
/usr/lib/gcc/i586-suse-linux/4.7/../../../../i586-suse-linux/bin/ld: note: 'stdscr' is defined in DSO /usr/lib/gcc/i586-suse-linux/4.7/../../../libtinfo.so so try adding it to the linker command line
/usr/lib/gcc/i586-suse-linux/4.7/../../../libtinfo.so: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status

Any ideas, this stuff normally just works? Thanks for any help.

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

No comments: