Working code for advanced programming on UNIX 2, preferably on Ubuntu / gcc4

I studied Linux system programming, and I am looking at APUE 2ed book by W. Richard Stevens and Stephen A. Rago.

The code provided at http://www.apuebook.com/ does not work. Undefined definitions, unrealized functions (given in the appendix)

Can someone point me to getting compiled code for APUE 2ed, preferably on Ubuntu / gcc4.

+4
source share
3 answers

rotkas has a github repository that contains modified code to compile it on modern systems. It worked for me on OSX 10.7 and Ubuntu 10.04. This has not been needed lately.

https://github.com/roktas/apue2e

+4
source

I downloaded the source, and then, according to the README file, edited Make.defines.linux and modified WKDIR to indicate where I unpacked the source code. Then I ran make and almost everything compiled with just a few warnings.

threadctl did not compile, and I had to change #include <limits.h> to #include <linux/limits.h> in getenv1.c and getenv3.c before it compiled (not sure if this is the best fix, but it works.)

+2
source

Thanks, Jacinda for the link that worked for me, but I also needed to do something else.

I used the source code from github / roktas and used the following command to run programs

 gcc -o myls myls.c -I SCADDRESS/include/ -L SCADDRESS/lib/ -lapue 

if anyone has the same problem, you can go to this link .

0
source

All Articles