APUE.3 source code compilation (Ubuntu16.04)

I started reading APUE3 today. I encountered some small problems in the make source code. I wrote it down and made a reference for those in need.

First download the source code http://apuebook.com/code3e.html

After downloading, unzip it and enter the apue.3e directory:

Execute make, fail, prompt

make[1]: execvp: ../systype.sh: Permission denied

The systype.h file has limited access. I thought it was because sudo was not added, but after adding sudo, it still reported an error, so I had no choice but to change the file attributes:

sudo chmod 777 systype.sh

Continue to execute make and continue to report errors:

/bin/sh: 1: ./fixup.awk: Permission denied

. . . Proceed to change file permissions (details are not listed)

Continue to report the error after the change:

/usr/bin/ld: cannot find -lbsd
collect2: error: ld returned 1 exit status

After Baidu found the reason, the static link library of libbsd.a was not added (http://blog.sina.com.cn/s/blog_94977c890102vdms.html)

After finding the cause, execute the following code:

sudo apt-get install libbsd-dev

Continue to make, success.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326605301&siteId=291194637