在编译《Linux/UNIX系统编程手册》的源代码时,提示:
cat@ubuntu:~/linux/tlpi-dist/lib$ make
cc -c -g -std=c99 -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE -g -I../lib -pedantic -Wall -W -Wmissing-prototypes -Wno-sign-compare -Wno-unused-parameter *.c
userns_functions.c:25:28: fatal error: sys/capability.h: No such file or directory
compilation terminated.
Makefile:17: recipe for target '../libtlpi.a' failed
make: *** [../libtlpi.a] Error 1
上网搜索一下,居然找到了作者维护的一个网页(链接),其中有说明如何解决这个问题。
If you encounter the error sys/capability.h: No such file or directory, it is because a required package is not installed on your system.
On Debian or Ubuntu, something like the following should work:
$ sudo apt-get install libcap-dev
执行安装命令:
cat@ubuntu:~/linux$ sudo apt-get install libcap-dev
然后再编译,就正常了。