I have to write a program with ncurses

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