PDA

View Full Version : I have add -lncurses ,but still can't link.



intijk
May 10th, 2008, 12:16 AM
code:

#include <ncurses.h>
int main()
{
initsrc();
endwin();
return 0;
}

then:

gcc test.c -lncurses

but it shows :

/tmp/ccOtOxfi.o: In function `main':
hellocurses.c:(.text+0x12): undefined reference to `initsrc'


I have install the libncurses5.dev

and I can make sure I have the libncurses.a now.

But still the problem exist.

Anyone could help me ?

Thank you!

samjh
May 10th, 2008, 12:28 AM
The function is initscr();

:)

intijk
May 10th, 2008, 03:27 PM
Thank you very much!:)