Cliclock CC Build Error' undefined reference'

时间:2017-10-17 14:31:54

标签: linux ubuntu cc

当我遇到此错误时,我试图在ubuntu 16.04 LTS上构建cliclock

~/Git/cliclock on  master took 7s 
➜ make
build clock.c
CC -Wall -lcurses clock.c
clock.c:17:21: fatal error: ncurses.h: No such file or directory
compilation terminated.
Makefile:11: recipe for target 'cli-clock' failed
make: *** [cli-clock] Error 1

我设法通过安装libncurses5-dev然后再安装

来解决这个问题
~/Git/cliclock on  master took 5s 
➜ make
build clock.c
CC -Wall -lcurses clock.c
/tmp/cch1W8PI.o: In function `init':
clock.c:(.text+0x2a): undefined reference to `initscr'
clock.c:(.text+0x2f): undefined reference to `cbreak'
clock.c:(.text+0x34): undefined reference to `noecho'
clock.c:(.text+0xe95): undefined reference to `wmove'
clock.c:(.text+0xeb7): undefined reference to `waddnstr'
clock.c:(.text+0xed5): undefined reference to `wmove'
clock.c:(.text+0xef7): undefined reference to `waddnstr'
/tmp/cch1W8PI.o: In function `clock_move':
clock.c:(.text+0xf3d): undefined reference to `mvwin'
/tmp/cch1W8PI.o: In function `key_event':
clock.c:(.text+0x1091): undefined reference to `stdscr'
clock.c:(.text+0x1099): undefined reference to `wgetch'
/tmp/cch1W8PI.o: In function `main':
clock.c:(.text+0x12ed): undefined reference to `endwin'
collect2: error: ld returned 1 exit status
Makefile:11: recipe for target 'cli-clock' failed
make: *** [cli-clock] Error 1

我是这种语言的新手。这与依赖关系有关,还是clock.c文件中有错误?

0 个答案:

没有答案