i was learning Linux system p开发者_如何学JAVArogramming and i am going through the APUE 2ed book by W. Richard Stevens and Stephen A. Rago.
The code given on http://www.apuebook.com/ does not work. Undefined definitions, un-implemented functions (given in appendix)
Can anyone point me to getting-compiled code for APUE 2ed, preferably on Ubuntu/gcc4.
rotkas has a github repo that contains the code with modifications to make it compile on modern systems. It worked for me on OSX 10.7 and Ubuntu 10.04. Haven't needed it recently, though.
https://github.com/roktas/apue2e
I downloaded the source and then, as per the README file, edited Make.defines.linux and changed WKDIR to point to where I had unpacked the source code. Then I ran make and just about everything compiled with only a few warnings.
threadctl didn't compile, though, and I had to change #include <limits.h>
to #include <linux/limits.h>
in getenv1.c and getenv3.c before it would compile (not sure if this is the best fix, but it works.)
Thank you Jacinda for the link it worked for me, but I had to do something else too
I used the source code from github/roktas and used the following command in order to run the programs
gcc -o myls myls.c -I SCADDRESS/include/ -L SCADDRESS/lib/ -lapue
if anyone has the same problem can go to this link.
精彩评论