conflicting types for 'timer_t' 的解决

编译程序时遇到conflicting types for 'timer_t'  问题的的解决

http://goodies.xfce.org/提供了许多Xfce环境下的插件,其中有个电池监视器插件,按照安装说明中的步骤编译时出现如下错误:

In  file included from . / libapm.h: 21 ,
                 from battery.c:
39 :
/ usr / include / sys / types.h: 62 : error: conflicting types  for  'dev_t'
/ usr / include / linux / types.h: 19 : error: previous declaration of 'dev_t' was here
/ usr / include / sys / types.h: 67 : error: conflicting types  for  'gid_t'
/ usr / include / linux / types.h: 53 : error: previous declaration of 'gid_t' was here
/ usr / include / sys / types.h: 72 : error: conflicting types  for  'mode_t'
/ usr / include / linux / types.h: 21 : error: previous declaration of 'mode_t' was here
/ usr / include / sys / types.h: 77 : error: conflicting types  for  'nlink_t'
/ usr / include / linux / types.h: 22 : error: previous declaration of 'nlink_t' was here
/ usr / include / sys / types.h: 82 : error: conflicting types  for  'uid_t'
/ usr / include / linux / types.h: 52 : error: previous declaration of 'uid_t' was here
In  file included from  / usr / include / sys / types.h: 133 ,
                 from .
/ libapm.h: 21 ,
                 from battery.c:
39 :
/ usr / include / time.h: 105 : error: conflicting types  for  'timer_t'
/ usr / include / linux / types.h: 28 : error: previous declaration of 'timer_t' was here
In  file included from  / usr / include / sys / types.h: 220 ,
                 from .
/ libapm.h: 21 ,
                 from battery.c:
39 :
/ usr / include / sys / select.h: 78 : error: conflicting types  for  'fd_set'
/ usr / include / linux / types.h: 18 : error: previous declaration of 'fd_set' was here
In  file included from . / libapm.h: 21 ,
                 from battery.c:
39 :
/ usr / include / sys / types.h: 235 : error: conflicting types  for  'blkcnt_t'
/ usr / include / linux / types.h: 151 : error: previous declaration of 'blkcnt_t' was here
make[
2 ]:  ***  [xfce4_battery_plugin - battery.o] Error  1
make[
2 ]: Leaving directory ` / tmp / xfce4 - battery - plugin - 0.5 . 1 / panel - plugin'
make[
1 ]:  ***  [all - recursive] Error  1
make[
1 ]: Leaving directory ` / tmp / xfce4 - battery - plugin - 0.5 . 1 '

make: *** [all] Error 2

 

解决方法:

打开panel-plugin/libapm.h

将如下两行的位置互换

#include <linux/apm_bios.h>

#include <sys/types.h>

变成

#include <sys/types.h>

#include <linux/apm_bios.h>

 

重新编译,通过!

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值