免费注册 查看新帖 |

Chinaunix

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

[内核入门] linux内核编译错误 高手们看过来 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-07-02 15:26 |只看该作者 |倒序浏览
In file included from /usr/include/sys/time.h:31,
                 from /usr/include/linux/input.h:12,
                 from samples/hidraw/hid-example.c:14:
/usr/include/sys/select.h:78: 错误:与 ‘fd_set’ 类型冲突
/usr/include/linux/types.h:12: 错误:‘fd_set’ 的上一个声明在此
In file included from /usr/include/linux/input.h:14,
                 from samples/hidraw/hid-example.c:14:
/usr/include/sys/types.h:62: 错误:与 ‘dev_t’ 类型冲突
/usr/include/linux/types.h:13: 错误:‘dev_t’ 的上一个声明在此
/usr/include/sys/types.h:67: 错误:与 ‘gid_t’ 类型冲突
/usr/include/linux/types.h:27: 错误:‘gid_t’ 的上一个声明在此
/usr/include/sys/types.h:72: 错误:与 ‘mode_t’ 类型冲突
/usr/include/linux/types.h:15: 错误:‘mode_t’ 的上一个声明在此
/usr/include/sys/types.h:77: 错误:与 ‘nlink_t’ 类型冲突
/usr/include/linux/types.h:16: 错误:‘nlink_t’ 的上一个声明在此
/usr/include/sys/types.h:82: 错误:与 ‘uid_t’ 类型冲突
/usr/include/linux/types.h:26: 错误:‘uid_t’ 的上一个声明在此
In file included from /usr/include/sys/types.h:133,
                 from /usr/include/linux/input.h:14,
                 from samples/hidraw/hid-example.c:14:
/usr/include/time.h:105: 错误:与 ‘timer_t’ 类型冲突
/usr/include/linux/types.h:22: 错误:‘timer_t’ 的上一个声明在此
In file included from /usr/include/linux/input.h:14,
                 from samples/hidraw/hid-example.c:14:
/usr/include/sys/types.h:235: 错误:与 ‘blkcnt_t’ 类型冲突
/usr/include/linux/types.h:114: 错误:‘blkcnt_t’ 的上一个声明在此
samples/hidraw/hid-example.c:15:26: 错误:linux/hidraw.h:没有那个文件或目录
samples/hidraw/hid-example.c: In function ‘main’:
samples/hidraw/hid-example.c:48: 错误:‘rpt_desc’ 的存储大小未知
samples/hidraw/hid-example.c:49: 错误:‘info’ 的存储大小未知
samples/hidraw/hid-example.c:65: 错误:‘HIDIOCGRDESCSIZE’ 未声明 (在此函数内第一次使 用)
samples/hidraw/hid-example.c:65: 错误:(即使在一个函数内多次出现,每个未声明的标识符 在其
samples/hidraw/hid-example.c:65: 错误:所在的函数内只报告一次。)
samples/hidraw/hid-example.c:73: 错误:‘HIDIOCGRDESC’ 未声明 (在此函数内第一次使用)
samples/hidraw/hid-example.c:84: 警告:隐式声明函数 ‘HIDIOCGRAWNAME’
samples/hidraw/hid-example.c:91: 警告:隐式声明函数 ‘HIDIOCGRAWPHYS’
samples/hidraw/hid-example.c:98: 错误:‘HIDIOCGRAWINFO’ 未声明 (在此函数内第一次使用)
samples/hidraw/hid-example.c:49: 警告:未使用的变量 ‘info’
samples/hidraw/hid-example.c:48: 警告:未使用的变量 ‘rpt_desc’
samples/hidraw/hid-example.c: In function ‘bus_str’:
samples/hidraw/hid-example.c:171: 错误:‘BUS_VIRTUAL’ 未声明 (在此函数内第一次使用)
make[2]: *** [samples/hidraw/hid-example] 错误 1
make[1]: *** [samples/hidraw] 错误 2
make: *** [vmlinux] 错误 2

我百度了一下 貌似有很多人在CentOS 5下出现过类似的错误
我没有改内核配置 全部采用默认配置编译
结果还是同样的错误
看有没有高手遇到过类似的问题

论坛徽章:
2
CU大牛徽章
日期:2013-04-17 11:46:28CU大牛徽章
日期:2013-04-17 11:46:39
2 [报告]
发表于 2012-07-02 21:38 |只看该作者
你是怎么编译?有没详细步骤?

论坛徽章:
0
3 [报告]
发表于 2012-07-03 08:27 |只看该作者
谢谢你的回复
我在/usr/include下建了asm  linux 和scsi的软链接 分别指向 新内核的这三个文件夹 编译通过了
现在的问题是 新内核无法启动 网上说没有开启对旧内核的支持
而且 我在下载的内核源码包里 没有找到 .config文件
我运行make xconfig 它直接改的是/boot下的旧配置文件

回复 2# cdtits


   

论坛徽章:
0
4 [报告]
发表于 2012-07-11 13:36 |只看该作者
回复 3# yongbaolinux


    .config 是make menuconfig出来的吧

论坛徽章:
0
5 [报告]
发表于 2012-07-11 14:15 |只看该作者
是的回复 4# 怪怪虎


   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP