免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1963 | 回复: 3
打印 上一主题 下一主题

请教高手看看这个问题怎么解决 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-10-17 10:24 |只看该作者 |倒序浏览
我有两个文件。一个是源文件,另一个是头文件,在编译时出现以下错误:
In file included from /usr/include/linux/wireless.h:74,
                 from defs.h:8,
                 from guonana.c:1:
/usr/include/linux/if.h:86: field `ifru_addr' has incomplete type
/usr/include/linux/if.h:87: field `ifru_dstaddr' has incomplete type
/usr/include/linux/if.h:88: field `ifru_broadaddr' has incomplete type
/usr/include/linux/if.h:89: field `ifru_netmask' has incomplete type
/usr/include/linux/if.h:90: field `ifru_hwaddr' has incomplete type
In file included from defs.h:8,
                 from guonana.c:1:
/usr/include/linux/wireless.h:536: field `ap_addr' has incomplete type
/usr/include/linux/wireless.h:537: field `addr' has incomplete type
guonana.c: In function `sip_ipreq_send':
guonana.c:391: warning: passing arg 1 of `sip_ipreq_create' makes pointer from integer without a cast
guonana.c: In function `main':
guonana.c:403: warning: passing arg 1 of `sip_ipreq_send' makes pointer from integer without a cast
make[1]: *** [guonana.o] Error 1
make[1]: Leaving directory `/root/guo'
make: *** [all] Error 2
这是什么问题啊?谢谢!

论坛徽章:
0
2 [报告]
发表于 2008-10-17 11:29 |只看该作者

回复 #1 qiaokai_492000 的帖子

你是不是调了 内核的一些定义

内核的定义总会有#ifdef __KERNEL__
这个语句,所以你普通包含的话,是不能包含他的定义的,所以会出现类型不完整的错误
你可以在你的.h文件里面加上#define __KERNEL__

论坛徽章:
0
3 [报告]
发表于 2008-10-17 16:17 |只看该作者
谢谢。我已经解决了这个问题

论坛徽章:
0
4 [报告]
发表于 2008-10-17 16:27 |只看该作者

回复 #3 qiaokai_492000 的帖子

讲一下,怎么解决的,大家一起学习下啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP