Undefined reference to `stdscr' while using ncurses

前端 未结 6 994
被撕碎了的回忆
被撕碎了的回忆 2020-12-02 01:58

I am trying to compile my code in Ubuntu 11.10 and getting these errors and more.So far by googling it I think it is a linking error. Specifically, there have been suggestio

6条回答
  •  既然无缘
    2020-12-02 02:20

    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.

提交回复
热议问题