programming with ncurses

nmh's Avatar, Join Date: Sep 2007
Go4Expert Member
I have to write a program with ncurses

#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;
to learn I use above code. It gives en error message

/tmp/ccJ7KVwh.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

reasons??? can u please help. I thank you in advance.

to compile I use this: - gcc test2.cpp -lncurses

Last edited by shabbir; 10May2008 at 09:13.. Reason: Code block
al2k8ht's Avatar, Join Date: Apr 2010
Newbie Member
Whats that ur using is it in console??

try compiling using g++ -oobjectname filename.cpp -lncurses

This is how i used in fedora to compile c++ Ncurses