没有curses.h头文件怎么办?

wingyip 2009-08-04 10:35:26
我在编写一个程序,编译出错提示:错误: curses.h:没有该文件或目录

#include<stdio.h>
#include<curses.h>

int main()
{
initscr();

clear();
move(10,20);
addstr("Hello,world");
move(20-1,0);
refresh();
getch();
endwin();
return 0;
}
...全文
3543 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
hello__world_ 2011-11-24
  • 打赏
  • 举报
回复
链接那个头文件吧[Quote=引用 10 楼 china_ludawei 的回复:]
多谢了。
[/Quote]
hello__world_ 2011-11-24
  • 打赏
  • 举报
回复
谢谢啊 呵呵 我也遇到这个问题了
最后一个菜鸟 2011-06-21
  • 打赏
  • 举报
回复
-lncurse是什么意思
china_ludawei 2011-06-08
  • 打赏
  • 举报
回复
多谢了。
ruanjianxz 2011-01-04
  • 打赏
  • 举报
回复
十分感谢 我的也解决了
j200300 2010-06-16
  • 打赏
  • 举报
回复
我也有相同的問題><
wingyip 2009-08-04
  • 打赏
  • 举报
回复
好的 多谢多谢
Jagen在路上 2009-08-04
  • 打赏
  • 举报
回复
你的编译选项后面加上-lncurses
wingyip 2009-08-04
  • 打赏
  • 举报
回复
按照楼上的命令成功安装了
还是编译不通过
错误:
7_2_hello2.c:(.text+0x12): undefined reference to `initscr'
7_2_hello2.c:(.text+0x17): undefined reference to `stdscr'
7_2_hello2.c:(.text+0x1f): undefined reference to `wclear'
7_2_hello2.c:(.text+0x36): undefined reference to `stdscr'
7_2_hello2.c:(.text+0x49): undefined reference to `wmove'
7_2_hello2.c:(.text+0x58): undefined reference to `stdscr'
7_2_hello2.c:(.text+0x64): undefined reference to `stdscr'
7_2_hello2.c:(.text+0x7c): undefined reference to `waddnstr'
7_2_hello2.c:(.text+0x81): undefined reference to `stdscr'
7_2_hello2.c:(.text+0x8f): undefined reference to `stdscr'
7_2_hello2.c:(.text+0xa7): undefined reference to `waddnstr'
7_2_hello2.c:(.text+0xb0): undefined reference to `LINES'
7_2_hello2.c:(.text+0xbe): undefined reference to `stdscr'
7_2_hello2.c:(.text+0xc6): undefined reference to `wrefresh'
7_2_hello2.c:(.text+0xcb): undefined reference to `stdscr'
7_2_hello2.c:(.text+0xd3): undefined reference to `wgetch'
7_2_hello2.c:(.text+0xd8): undefined reference to `endwin'
Jagen在路上 2009-08-04
  • 打赏
  • 举报
回复
应该是apt-get install libncurses5-dev
wingyip 2009-08-04
  • 打赏
  • 举报
回复
按照的命令 sudo了一遍 得到下面的提示,重新编译了一遍程序还是提示同样的错误

正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
E: 无法找到软件包 libcurses5-dev
ShowMan 2009-08-04
  • 打赏
  • 举报
回复
装libcurses包
apt-get install libcurses5-dev

23,120

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧