Beginner "Unix environment advanced programming" friends will encounter a problem, run inside the instance (download: http://www.apuebook.com/) problems, prompt "error: apue. h: No file or directory ".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 the tar.gz package of the website downlowd apue and decompress it to a directory on the computer. For example, if my package is under/home/user/, go to the decompressed directory apue.2e and modify make. defines. in Linux, wkdir =/home/XXX/apue.2e is wkdir =/home/user/apue.2e. This is the working directory we will make and then enter the STD directory, use VI to open Linux. MK to change all the nawk in it to awk. You can use this command
: % S/nawk/awk/g(Note that there is a colon Before)
Then make
Perform the following steps:
1. logon with Super User Permissions # cd/usr/include
2. Copy the apue. h and error. c files to this 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:
# Cp/home/ucfree/apue.2e/inlcude/apue. h.
# Cp/home/ucfree/apue.2e/lib/error. c.(Implement the error handling function in apue. h)
3. Edit apue. h.
# Vi apue. h
In the last line # endifAdd a line # include "error. c"
: WQ save, exit.
In this way, you can run the downloaded apue program.