分页: 1 / 1

关于curses

发表于 : 2008-12-03 12:18
小左
小弟刚开始学关于curses和ncurses编程,写了这样一个极其简单的程序:

代码: 全选

//hello.c
#include <ncurses.h>
int main()
{
initscr();
printw("Hello!");
refresh();
getch();
endwin();
return 0;
}
然后这样编译:
gcc -o -lncurses hello hello.c
问题出现了,提示:
gcc :hello:No such file or directory
hello.c :1:21:error:ncurses.h:No such file or directory
但是我的/lib/libncurses.so是存在的,请问各位大侠,这是怎么回事啊,怎么解决啊?
谢谢拉

Re: 关于curses

发表于 : 2008-12-03 20:07
xyywll
请问 gcc -o -lncurses hello hello.c 里,hello 是谁的参数

gcc -o hello hello.c -lncurses

Re: 关于curses

发表于 : 2008-12-04 14:25
小左
感谢xyywll的回答,我用
gcc -o hello hello.c -lncurses
编译,结果是:
hello.c :1:21:error:ncurses.h:No such file or directory
这到底是怎么回事啊,我用的是ubuntu8.10,是不是这个版本的库有问题啊,好像数学库libmath也用不了

Re: 关于curses

发表于 : 2008-12-04 21:34
xyywll
libncurses5-dev 装了吗?

Re: 关于curses

发表于 : 2008-12-04 21:47
ChenFengyuan
用linux的不一定会c
c的问题去comp.lang.c和comp.lang.c.modera问比较好