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.