【发布时间】:2009-04-30 04:32:04
【问题描述】:
我正在尝试开始在 Linux 上使用 ncurses 开发程序。我什至无法编译 Hello World 示例。代码如下:
#include <curses.h>
int main()
{
initscr();
printw("Hello, world.");
refresh();
getch();
endwin();
return 0;
}
当我尝试编译时,我得到:
hello.c:(.text+0x12): undefined reference to `initscr'
对于每一个被调用的函数。
我通过 apt-get 安装了 ncurses,也通过下载源代码和编译、安装等方式安装了 ncurses。
#includecurses.h 和 ncurses.h 我都试过了。
发生了什么事?
【问题讨论】: