日期:2014-05-16 浏览次数:20898 次
sss@sss-desktop:~/apue.2e$ uname -a
Linux sss-desktop 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:08:37 UTC 2011 i686 GNU/Linux
To build the source, edit the Make.defines.* file for your system and set
WKDIR to the pathname of the tree containing the source code.
我的系统是linux 所有我需要打开Make.defines.linux文件把#WKDIR=/home/sar/apue.2e改为
WKDIR=/home/sss/apue.2e (这是我放代码的位置)
sss@sss-desktop:~/apue.2e/threadctl$ make
gcc -DLINUX -ansi -I/home/sssz/apue.2e/include -Wall -D_GNU_SOURCE -c -o detach.o detach.c
gcc -DLINUX -ansi -I/home/sss/apue.2e/include -Wall -D_GNU_SOURCE -c -o getenv1.o getenv1.c
getenv1.c:4: error: ‘ARG_MAX’ undeclared here (not in a function)
make: *** [getenv1.o] 错误 1
#define ARG_MAX 4096
sss@sss-desktop:~/apue.2e/threadctl$ make -f linux.mk
gcc -DLINUX -ansi -I/home/sss/apue.2e/include -Wall -D_GNU_SOURCE -c -o getenv1.o getenv1.c
gcc -DLINUX -ansi -I/home/sss/apue.2e/include -Wall -D_GNU_SOURCE -c -o getenv2.o getenv2.c
gcc -DLINUX -ansi -I/home/sss/apue.2e/include -Wall -D_GNU_SOURCE -c -o getenv3.o getenv3.c
gcc -DLINUX -ansi -I/home/sss/apue.2e/include -Wall -D_GNU_SOURCE -L../lib atfork.c ../lib/libapue.a -pthread -o atfork
gcc -DLINUX -ansi -I/home/sss/apue.2e/include -Wall -D_GNU_SOURCE -c -o timeout.o timeout.c
timeout.c: In function ‘main’:
timeout.c:93: warning: ‘condition’ is used uninitialized in this function
timeout.c:95: warning: ‘arg’ may be used uninitialized in this function
gcc -DLINUX -ansi -I/home/sss/apue.2e/include -Wall -D_GNU_SOURCE timeout.o detach.o ../lib/libapue.a -pthread -o timeout
gcc -DLINUX -ansi -I/home/sss/apue.2e/include -Wall -D_GNU_SOURCE -L../lib suspend.c ../lib/libapue.a -pthread -o suspend
./configure