The solution of not finding apue.h in the header file of UNIX network programming
Go to the Internet to download an apue.h header file, Baidu, a lot, I downloaded here: http://www.apuebook.com/src.tar.gz, download, decompress to your root directory, is your user's directory
Such as:
My files are under Src. I use Redhat9. USB drives need to be mounted manually.
Now that you have completed the first step, find this file in apue.2e:
Make.defines.linux this file, open with the VI editor, I am a privileged user to enter, anyway, it is VM, broken can be re-installed, do not worry about this. Modify the path inside.
Change it to the position you said. It should be noted here that at the bottom of the above picture there is a CC, editor, generally speaking, it is OK to use Gcc, but the time for editing my C program needs to be added 296, so change it to GCC296, if your VI editor is edited with gcc296 *. C-o *, be sure to change it here.
Now you can change the linux and mk files in std, and change all nawk to awk.
Copy the apue.h file in include in apue.2e and the error.c file in lib in apue.2e to / usr/include.
Then go to the apue.2e lib file directory
Type the command make-f linux.mk command to generate the libapue.a file and copy the file to / usr/lib and / usr/lib64.
I originally planned to do it in crywin, but I found that without the make command, it should be solved.
At this point you can edit the file.
# include
# include "apue.h"
Int
Main ()
{
Printf ("hello wold from process pid =% d", getpid ())
Exit (0)
}
It could go wrong. It will also indicate that the apue.h header file cannot be found.
Here, just change # include "apue.h" to # include.