Compile apue source code on MacBook Air

Source: Internet
Author: User
Tags macbook

Overall CompilationCode

1. Decompress src.rar and release the file to the root directory of the current user (/users/lishujun /)

2. Access/users/lishujun/apue.2e.

3. Modify the make. Define. MACOs file and specify the directory where the source code is located.

 
Wkdir =/users/lishujun/apue.2e

4. Go to the/users/lishujun/apue.2e/include directory and modify apue. h.

 
# IfDefined (Solaris)# Define_ Xopen_source 500/* single UNIX specification, version 2 for Solaris 9 */# DefineCmsg_len (x) _ cmsg_data_align (sizeof (struct cmsghdr) + (x ))# ElifDefined (MACOs)/* adds this line. Note that there is no exclamation point */# Elif! Defined (BSD)# Define_ Xopen_source 600/* single UNIX specification, version 3 */# Endif

5. Return to the upper-level directory and execute the compilation command.

MakeCleanMakeMacOS

6. Verify that the compilation is successful. Go to the/users/lishujun/apue.2e/file directory, modify ls1.c, and change the header file to ../include/apue. H. Then

 
GccLs1.c ../lib/libapue.

The A. out file is ls.

 

 

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.