OS X 10.10 Compiling apue third Edition source code

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.