apue make错误

gcc -DLINUX -ansi -I/home/alex/apue/apue.2e/include -Wall -D_GNU_SOURCE -DDEBUG  -c -o printd.o printd.c
In file included from /usr/include/bits/time.h:86:0,
                 from /usr/include/time.h:42,
                 from /usr/include/pthread.h:26,
                 from printd.c:11:
/usr/include/bits/timex.h:31:7: 错误:expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘.’ token
make[2]: *** [printd.o] 错误 1
make[2]: 离开目录“/home/alex/apue/apue.2e/ipp”
make[1]: *** [linux] 错误 1
make[1]: 离开目录“/home/alex/apue/apue.2e”

make: *** [all] 错误 2


出现这个问题的原因是在timex.h的第31行出现了status的定义:
  int status;                /* clock command/status */

而文件apue.2e/ipp/ipp.h中有宏定义:
#define status u.st

这样编译的时候就出问题了,如编译提示:
expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘.’ token

解决方法是把ipp.h文件里的status改成其他名称,比如Status,再次编译,错误提示status神马的信息,找到status出错的位置,把它改为Status就行了。
此处我的status出错位置在printd.c的第977行中:
                        i = ntohs(hp->status);






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值