How to Use apue source code (UNIX advanced programming)

Source: Internet
Author: User

Method 1:
1. apue2 source code download: http://www.apuebook.com/src.tar.gz
2. I saved it to/root. decompress: tar-xzvf src.tar.gz
3. Run CD apue.2e To Go To The apue.2e directory and check readme. This tells us that you only need to modify make. Defines. Linux and then make
4. In VI make. Defines. Linux, modify wkdir =/root/apue.2e to indicate that the working directory is wkdir =/root/apue.2e.
5. Modify/root/apue.2e/STD/Linux. mk to change all nawk to awk. Because some Linux do not have nawk by default
6. Make

Now, you can copy it to what you can look for. When writing an example, you can

4. Copy apue2e_src/apue.2e/include/apue. h and apue2e_src/apue.2e/lib/libapue..

Go to your source code directory.

5. Use gcc-O hello. c libapue. A to compile your source code.

 
Method 2:
Examples of apue programming are related to include "apue. H "code, in fact, apue. H is not included in the system. It is the header file compiled by the author. The source code is in appendix B. therefore, one method is. put the generated/root/apue.2e/include/apue. copy h directly to/usr/include.
Functions like err_sys are also included in appendix B. the same method is to create a my_err.h file in/usr/include and copy the content of Figure B .3. error functions that output to standard error. in this way, you only need to add # include "my_err.h" at the beginning of the line for example programming ..

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/csufuyi/archive/2008/03/25/2218074.aspx

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.