Unix环境高级编程第三版源码编译错误
编译书本上的源代码遇到如下问题: 1. systype.shapue.3e
apue.3e$ ll systype.sh
-rw-r--r-- 1 jack jack 467 7月 5 2012 systype.sh
apue.3e$ chmod +x systype.sh
apue.3e$ ll systype.sh
-rwxr-xr-x 1 jack jack 467 7月 5 2012 systype.sh*
2. fixup.awkmaking advio
make[1]: Entering directory '/home/jack/samba_share/apue/apue.3e/advio'
gcc -ansi -I../include -Wall -DLINUX -D_GNU_SOURCE deadlock.c -o deadlock -L../lib -lapue -lrt
gcc -ansi -I../include -Wall -DLINUX -D_GNU_SOURCE mandatory.c -o mandatory -L../lib -lapue -lrt
gcc -ansi -I../include -Wall -DLINUX -D_GNU_SOURCE mcopy2.c -o mcopy2 -L../lib -lapue -lrt
gcc -ansi -I../include -Wall -DLINUX -D_GNU_SOURCE nonblockw.c -o nonblockw -L../lib -lapue -lrt
gcc -ansi -I../include -Wall -DLINUX -D_GNU_SOURCE rot13a.c -o rot13a -L../lib -lapue -lrt
./fixup.awk rot13a.c >xlate
/bin/sh: 1: ./fixup.awk: Permission denied
Makefile:18: recipe for target 'rot13c2.c' failed
make[1]: *** [rot13c2.c] Error 126
make[1]: Leaving directory '/home/jack/samba_share/apue/apue.3e/advio'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 1
解决方法: apue.3e$ ll advio/fixup.awk
-rw-r--r-- 1 jack jack 172 7月 5 2012 advio/fixup.awk
apue.3e$ chmod +x advio/fixup.awk
apue.3e$ ll advio/fixup.awk
-rwxr-xr-x 1 jack jack 172 7月 5 2012 advio/fixup.awk*
3. libbsd-devmake[1]: Leaving directory '/home/jack/samba_share/apue/apue.3e/threadctl'
making threads
make[1]: Entering directory '/home/jack/samba_share/apue/apue.3e/threads'
gcc -ansi -I../include -Wall -DLINUX -D_GNU_SOURCE badexit2.c -o badexit2 -L../lib -lapue -pthread -lrt -lbsd
/usr/bin/ld: cannot find -lbsd
collect2: error: ld returned 1 exit status
Makefile:31: recipe for target 'badexit2' failed
make[1]: *** [badexit2] Error 1
make[1]: Leaving directory '/home/jack/samba_share/apue/apue.3e/threads'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 1
解决方法: apue.3e$ sudo apt-get install libbsd-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.10.0-27 linux-
.......... (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |