关于linux modules 的问题!!!!!!
我看网上一位叫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: *** Error 1
谢谢 有几种可能:
1,内核的版本不对;
2,头文件没有包含或包含的顺序有误
其它的错误是指针类型转换的问题,好解决。 我的2.4.2内核编译一切正常!!!!!!!!!!!!!!!! 哦!谢谢经过你的提醒我在,公社中找到了解决的办法,是我的makefile没有写对-I /usr/src/....... :P "/usr/include/linux/ti.."
u found the problem. u used user space header files
页:
[1]