unix环境高级编程apue.h文件头的安装

工作了,以前只停留在pad里的书都想入手。手里有了unix网络编程卷1卷2,最近看ceph源码的过程中,越来越发现需要补充unix环境高级编程的知识。

从pad中走向了实体书。中午快递到货,迫不及待的翻开了。第一件事,安装

 #include"apue.h"

1.官网下载

下载传送门

2.解压make

安装点依赖gcc make啥的
一make,果然报错,人生啊总是要走很多“弯”路。

/tmp/ccMkguDl.o: In function `thr_fn':
barrier.c:(.text+0x80): undefined reference to `heapsort'
collect2: error: ld returned 1 exit status
make[1]: *** [barrier] Error 1
make[1]: Leaving directory `/root/apue.3e/threads'
make: *** [all] Error 1
[root@localhost apue.3e]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.cn99.com
 * epel: mirror.lzu.edu.cn
 * extras: mirrors.shu.edu.cn
 * updates: mirrors.cn99.com
No packages marked for update

在这里缺少一个libbsd
下载

wget http://elrepo.reloumirrors.net/testing/el6/x86_64/RPMS/libbsd-devel-0.2.0-4.el6.elrepo.x86_64.rpm
wget http://elrepo.reloumirrors.net/testing/el6/x86_64/RPMS/libbsd-0.2.0-4.el6.elrepo.x86_64.rpm

安装

rpm -ivh libbsd-0.2.0-4.el6.elrepo.x86_64.rpm
rpm -ivh libbsd-devel-0.2.0-4.el6.elrepo.x86_64.rpm

3.重新make

成功

4.加入include

将apue.h中加入#include”error.c”

void    log_exit(int, const char *, ...) __attribute__((noreturn));               
void    TELL_WAIT(void);        /* parent/child from {Sec race_conditions} */
void    TELL_PARENT(pid_t);
void    TELL_CHILD(pid_t);
void    WAIT_PARENT(void);
void    WAIT_CHILD(void);
#include"error.c"                                                                                                                                                              
#endif  /* _APUE_H */
cp include/apue.h lib/error.c /usr/include/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值