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"
无欲速,无见小利。欲速,则不达;见小利,则大事不成。