当前位置: 技术问答>linux和unix
关于linux module的问题!!!!!!!
来源: 互联网 发布时间:2015-04-30
本文导语: 我看网上一位叫kunlong 写的linux的模块,在编译的时候老是有问题 请老手指教一下!!!!!!!!! 代码的url: http://www.linuxeden.com/edu/doctext.php?docid=1463 编译后出现的错误是: /usr/include/linux/timer.h:45: parse error befo...
我看网上一位叫kunlong 写的linux的模块,在编译的时候老是有问题
请老手指教一下!!!!!!!!!
代码的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
谢谢
请老手指教一下!!!!!!!!!
代码的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
谢谢
|
把你编译的环境与合适的源码匹配:
mv /usr/include /usr/include_bak
ln -s /right-path /usr/include
重新编译
mv /usr/include /usr/include_bak
ln -s /right-path /usr/include
重新编译
|
up
|
你的kernel version?
|
你把错误代码贴出来,好给你说塞。
新手编出来经常是版本不匹配。
新手编出来经常是版本不匹配。
|
用gcc296代替gcc十一世
|
可能是内核源代码不兼容