QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1341|回复: 4

关于linux modules 的问题!!!!!!

[复制链接]
发表于 2003-10-15 15:39:15 | 显示全部楼层 |阅读模式
我看网上一位叫kunlong 写的linux的模块,在编译的时候老是有问题
请老手指教一下!!!!!!!!!我的内核是2。4。20-8
代码的url:
http://www.linuxeden.com/edu/doctext.php?docid=1463
编译后出现的错误是:
/usr/include/linux/timer.h:45: parse error before "spinlock_t"
/usr/include/linux/timer.h:53: parse error before '}' token
/usr/include/linux/timer.h:67: parse error before "tvec_base_t"
/usr/include/linux/timer.h:101: parse error before "tvec_bases"
/usr/include/linux/timer.h: In function `init_timer':
/usr/include/linux/timer.h:105: dereferencing pointer to incomplete type
/usr/include/linux/timer.h:105: dereferencing pointer to incomplete type
/usr/include/linux/timer.h:106: dereferencing pointer to incomplete type
/usr/include/linux/timer.h: In function `timer_pending':
/usr/include/linux/timer.h:121: dereferencing pointer to incomplete type
ping_filter.c:39: warning: `struct packet_type' declared inside parameter list
ping_filter.c: In function `filter_rcv':
ping_filter.c:41: dereferencing pointer to incomplete type
ping_filter.c:41: dereferencing pointer to incomplete type
ping_filter.c:43: dereferencing pointer to incomplete type
ping_filter.c:43: dereferencing pointer to incomplete type
ping_filter.c:45: dereferencing pointer to incomplete type
ping_filter.c:45: dereferencing pointer to incomplete type
ping_filter.c:45: dereferencing pointer to incomplete type
ping_filter.c:46: dereferencing pointer to incomplete type
ping_filter.c:48: dereferencing pointer to incomplete type
ping_filter.c:50: dereferencing pointer to incomplete type
ping_filter.c: At top level:
ping_filter.c:58: variable `filter_packet_type' has initializer but incomplete type
ping_filter.c:58: warning: excess elements in struct initializer
ping_filter.c:58: warning: (near initialization for `filter_packet_type')
ping_filter.c:58: warning: excess elements in struct initializer
ping_filter.c:58: warning: (near initialization for `filter_packet_type')
ping_filter.c:58: warning: excess elements in struct initializer
ping_filter.c:58: warning: (near initialization for `filter_packet_type')
ping_filter.c:58: warning: excess elements in struct initializer
ping_filter.c:58: warning: (near initialization for `filter_packet_type')
ping_filter.c:58: warning: excess elements in struct initializer
ping_filter.c:58: warning: (near initialization for `filter_packet_type')
ping_filter.c: In function `init_module':
ping_filter.c:64: warning: assignment makes pointer from integer without a cast
ping_filter.c:67: invalid use of undefined type `struct packet_type'
ping_filter.c: At top level:
ping_filter.c:58: storage size of `filter_packet_type' isn't known
make: *** [all] Error 1
谢谢
发表于 2003-10-21 16:36:34 | 显示全部楼层
有几种可能:
1,内核的版本不对;
2,头文件没有包含或包含的顺序有误
其它的错误是指针类型转换的问题,好解决。
回复

使用道具 举报

发表于 2003-10-21 16:48:47 | 显示全部楼层
我的2.4.2内核编译一切正常!!!!!!!!!!!!!!!!
回复

使用道具 举报

 楼主| 发表于 2003-10-21 16:55:26 | 显示全部楼层
哦!谢谢经过你的提醒我在,公社中找到了解决的办法,是我的makefile没有写对-I /usr/src/.......
回复

使用道具 举报

发表于 2003-10-27 23:02:13 | 显示全部楼层
"/usr/include/linux/ti.."

u found the problem. u used user space header files
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-11-17 06:38 , Processed in 0.042822 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表