我写了一个hello world程序来看看curses库是如何工作的。
下面是我的程序:
/Users/snihalani/dev/daas at 10:10AM
➜ cat main.c
#include <stdio.h>
#include <stdlib.h>
#include <curses.h>
int main(void)
{
int returnValue = 0;
while(1)
{
printf("I got %d\n", getch());
}
return 0;
}我运行了gcc main.c
我得到了
/Users/snihalani/dev/daas at 10:14AM
➜ gcc main.c
Undefined symbols for architecture x86_64:
"_stdscr", referenced from:
_main in ccEvUdhx.o
"_wgetch", referenced from:
_main in ccEvUdhx.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status我不知道哪里出了问题。有人能帮帮忙吗?
发布于 2012-11-05 23:28:56
不要紧。我不得不在编译时添加-lcurses选项。
https://stackoverflow.com/questions/13234943
复制相似问题