跳转至

APUE

Unix环境高级编程v3 Advanced Programming in the Unix Environment

书中源码下载

make进行编译

将111#include "error.h"```加到apue.h里面,再将两个文件移动至C的头文件目录

cp include/apue.h /usr/include
cp lib/error.c /usr/include

之后即可运行书中代码,如下

#include "apue.h"
int main() {
    printf("hello world fromm process ID %ld\n", (long)getpid());
    exit(0);
}
gcc test.c
./a.out # hello world fromm process ID 29841