Last summer was a simple study of the next Linux programming, at that time planning to be known as UNIX programming must see Apue (Unix Environment Advanced programming English full name is the programming in the UNIX environment, So referred to as Apue), but also in X Bao bought the second edition of the Chinese version. And to this year already has the third edition of the Chinese version, just as the library also has a new version, borrowed back, plus no plan so urgent to find internships and work, decided to sink to the heart, the book a good look.
Address of this series of books [Advanced programming in the UNIX? Environment] (http://www.apuebook.com "Apue"), there are various versions of the source code and related Materials.
The source code after the download is compiled, last summer in Ubuntu under the compilation, that time compiled second Edition, there are many errors, compile more trouble. By the time third edition, it was discovered that only one make was needed to solve the problem. However, use make or error, such as the following error, directly on Mac OS Yosemite:
make[111
The solution is:
That is to change extrald=-r. Extrald=-r (remove ".") )
Then make, if make is over, make the clean again.
This time if you cut to the source directory, such as to the intro directory, compile hello.c file is error, prompted you apue.h not defined, because there is a step not completed, that is, our apue.h and error.c copied to the Usr/include directory.
As shown below:
Then modify the edit/usr/include/apue.h file (using sudo permissions)
Include ERROR.C code before the last #endif of the file: #include "error.c"
The first example in the test book is the one.
The results are as follows:
The following can be a pleasant look at the writing code ~
Blog: Starting Address
Reprint please indicate source: http://blog.csdn.net/suool/article/details/47022777
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
OS X 10.10 Compiling apue third Edition source code