The Linux Programming Interface(Linux/Unix系统编程手册)源码编译报错踩坑记

Linux编程手册源码编译错误解决
在Windows环境下解压The Linux Programming Interface源码后,在Ubuntu 14.04虚拟机中编译遇到错误,如预期标识符错误。问题在于.c文件中包含上一级目录的文件,而Windows解压不支持此格式。解决方案是在Linux系统下解压,并安装libcap-dev包以解决sys/capability.h找不到的问题。
  1. 在 http://man7.org/tlpi/code/index.html 下载任意版本源码
  2. 由于我是windows+ubuntu1404虚拟机,因此在windows下用压缩软件解压后,复制tlpi-book文件夹进虚拟机
  3. cd tlpi-book/
    make 
  4. 报错,
    become_daemon.c:1:1: error: expected identifier or ‘(’ before ‘.’ token
     ../daemons/become_daemon.c
     ^
    binary_sems.c:1:1: error: expected identifier or ‘(’ before ‘.’ token
     ../svsem/binary_sems.c
     ^
    create_pid_file.c:1:1: error: expected identifier or ‘(’ before ‘.’ token
     ../filelock/create_pid_file.c
     ^
    ...
    ...
    ...
    make[1]: *** [Makefile:17: ../libtlpi.a] Error 1
    make[1]: Leaving directory '/home/yxp/Desktop/TLPI/tlpi-dist/lib'
    make[1]: Entering directory '/home/yxp/Desktop/TLPI/tlpi-dist/acl'
    make[1]: *** No rule to make target '../libtlpi.a', needed by 'acl_update'.  Stop.

    5. 看了一下makefile后发现其实后面的错就是这里要先生成一个静

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值