Undefined reference to `stdscr' while using ncurses

I was having this problem with an ncurses program on Centos 6.2. It turns out that ncurses is sometimes split into two libraries, ncurses and tinfo. In my case, stdscr exists in libtinfo, not in libncurses, so adding -ltinfo to the link line, after -lncurses, solved the problem.


I know you've moved on, but for future reference: when I encountered the same problem, it was due to the placement of the -l argument. Try:

skygrid: skygrid.o commServer.o pose.o robot.o
    $(LINK) -o $@ $^ $(LDFLAGS)

For more information, see the gcc manual: http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

and this thread on SO: Placement of `-l' option in gcc