Recently in the revision of APUE ("UNIX Environment Advanced Programming"), previously in Linux, and now intend to get down in their own machine, so Google, the compilation of things done, modify some of the tutorials some errors, such as download links and so on.
1, download source files, I am here is the second edition, looks like the third edition of the English version out ...
Copy Code code as follows:
wget http://www.apuebook.com/src.2e.tar.gz
2, decompression
Copy Code code as follows:
3, modify some things
Copy Code code as follows:
CD apue.2e/
Vim Make.defines.macos
WKDIR=/USERS/CHENQING/APUE.2E//Change the absolute path to your code
Vim include/apue.h
After line 11th, add the following three sentences
#ifdef MACOS
#define _darwin_c_source
#endif
4, compile
Copy Code code as follows:
5, copy
Copy Code code as follows:
sudo cp include/apue.h/usr/include/
sudo cp lib/error.c/usr/include/
6. Modify Apue.h
Add a row before the last line #endif #include "error.c"
7. Test
Copy Code code as follows:
#include <apue.h>
int main ()
{
Err_sys ("Some error found%d", getpid ());
return 0;
}