[TOC]linux
apue3.tar.gz 包解壓問題:docker
目前個人開發環境是,docker的/data
目錄掛載windows的 D:\workspace
目錄,可是在下面作tar解壓APUE3開發包時,出現瞭如下問題:windows
$ cd /data $ tar xzfv src.3e.tar.gz ... tar: apue.3e/figlinks/figB.4: Cannot create symlink to ‘../lib/errorlog.c’: Operation not supported tar: apue.3e/figlinks/figB.3: Cannot create symlink to ‘../lib/error.c’: Operation not supported tar: apue.3e/figlinks/figB.1: Cannot create symlink to ‘../include/apue.h’: Operation not supported ...
緣由是: NTFS 文件系統的問題,須要把這個包移到linux目錄中,再解壓dom
$ tar xzfv src.3e.tar.gz -C ~/apue3
成功!spa
解壓後,進入 apue.3e
目錄code
$ cd apue.3e $ make ... 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/admin/apue.3e/threads' Makefile:6: recipe for target 'all' failed make: *** [all] Error 1
出現了 cannot find -lbsd
的問題ip
看來是,缺庫 libbsdci
admin@7559451f5a58:~/apue.3e$ apt-cache search libbsd libbsd-dev - utility functions from BSD systems - development files libbsd-resource-perl - BSD process resource limit and priority functions libbsd0 - utility functions from BSD systems - shared library libbsd-arc4random-perl - CPAN's BSD::arc4random -- Perl bindings for arc4random
發現沒有 libbsd 而只有幾個相關的,想一想估計是libbsd自己就是做爲開發庫的緣由吧開發
admin@7559451f5a58:~/apue.3e$ sudo apt-get install libbsd-dev //....
搞定get