apue.h报错问题

下载apue.3e后进入make,提示错误如下:

collect2: error: ld returned 1 exit status
Makefile:31: recipe for target 'badexit2' failed
make[1]: *** [badexit2] Error 1
make[1]: Leaving directory '/home/pi/Downloads/apue.3e/threads'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 1

需要安装库:

sudo apt-get install libbsd-dev

然后:

cp ./include/apue.h /usr/include/  
cp ./lib/error.c /usr/include
cp ./lib/libapue.a /usr/local/lib/

 在apue.h最后加一行代码

#include "error.c"

 

posted @ 2017-11-30 13:19  习惯就好233  阅读(326)  评论(0编辑  收藏  举报