Sur*_*ani 9 curses compilation
我写了一个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;
}
Run Code Online (Sandbox Code Playgroud)
我跑了 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
Run Code Online (Sandbox Code Playgroud)
我不知道出了什么问题.有人可以帮忙吗?