apue.h報錯問題

下載apue.3e後進入make,提示錯誤以下:spa

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

須要安裝庫:code

sudo apt-get install libbsd-dev

而後:blog

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

 在apue.h最後加一行代碼ip

#include "error.c"
相關文章
相關標籤/搜索