Apue. h in advanced programming in UNIX environment

Source: Internet
Author: User

RunProgramListing 1-1 (listing all files in a directory)

 

Prompt"Error: apue. h: the file or directory does not exist.".

It was a hit, and Google was decisive.

Apue. H is a header file customized by the author, including common header files and error handling functions required by the program. So it should be put into the system header file (/usr/include in Linux), so that the GCC compiler can find it.

Go to http://www.apuebook.com/to downloadSrc.tar.gzPackage, and decompress the package to a directory on the computer. For example, if my package is in/home/user /,
 
User @ user-desktop :~ $ Sudo tar xzf src.tar.gz
Enter the extract directory Apue.2e, Modify Make. Defines. Linux In Wkdir =/Home/XXX/apue.2e, which is Wkdir =/Home/user/apue.2e Enter STD directory , Modify Linux. mk , Change all the nawk in to awk. Copy apue. h and error. c
Copy the apue. h and error. c files/Usr/include Directory. (Apue. H is located in your_apue_path/inlcude; error. C is located in your_apue_path/LIB)
Take my path as an example:

 
User @ user-desktop:/usr/include $ CP/home/user/apue.2e/inlcude/apue. h apue. h
User @ user-desktop:/usr/include $ CP/home/user/apue.2e/lib/error. c error. c(Implement the error handling function in apue. h)
Modify apue. h
Add a line before the last line # endif# Include "error. c"
It seems like this is OK.

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.