Linux Configuration Apue Compiler environment

Source: Internet
Author: User

Apue is the UNIX environment advanced programming, almost all the programs in this book contain a apue.h header file, how to configure this apue.h?

1, we can download in the Http://pan.baidu.com/s/1dDxmtbF, and then put on your Linux desktop (no desktop, feel free to put it)

2. Unzip the downloaded file:

Tar-zxv-f src.3e.tar.gz

3. Enter the extracted directory:

CD apue.3e/

4. Compiling:

Make

We will find that the following error occurred:

Can,t Find-lbsd

5. Download and add the libbsd.a static link library:

sudo apt-get Install Libbsd-dev

6. Compile again:

Make

Should be successful at this time, we put apue.h and libapue.a into the corresponding directory, with the following command to complete:

sudo cp./include/apue.h/usr/include/sudo cp. /lib/libapue.a/usr/local/lib/

Why would you want to move Libapue.a to/usr/local/lib?

The reason is that LIBAPUE.A is the concrete implementation of all functions and macro definitions contained in the Apue.h header file, and is a static link library.

View ld.conf.d/libc.conf you will find that GCC will search the link library by default when searching for files in/usr/local/lib/, so we'll put it here, once and for all .... (But I need to know OH)

7. Test environment:

The program on the GCC book. C-o Output name-lapue (Libapue.a here to write apue, specific GCC use rules can man, hehe)

Adapted from: http://blog.sina.com.cn/s/blog_94977c890102vdmu.html

Linux Configuration Apue Compiler environment

Related Article

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.