curses.h:没有该文件或目录

今天用codeblocks 写程序的时候发现编译器报错:
curses.h:没有该文件或目录

goolge一下,发现这篇文章
http://blog.chinaunix.net/u1/38038/showart_1201090.html
按照上面的描述,在包管理器中安装了libncurses5-dev(Developer's libraries and docs for ncurses) 便解决了问题。

这个时候不能使用codeblaocks的自带编译器,
因为lcurses.so,libcurse.a的库文件不在标准目录下,要gcc加上-lcurses进行编译

gcc screen1.c -o screen1 -lcurses
否则会出现undefined reference to `initscr'的编译器错误。

你可能感兴趣的:(C++,c,.net,gcc,C#)