LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1129|回复: 1

LINUX模块编译出现了许多包含的头文件语法错误,是怎么回事呀?

[复制链接]
发表于 2005-3-29 22:45:47 | 显示全部楼层 |阅读模式
报错情况如下,请大侠指点,谢谢!!
[root@localhost e-disk]# gcc  -c test3.c -I /usr/src/linux/ -DMOUDLE -D_KERNEL__                                                                                
In file included from /usr/include/linux/fs.h:23,
                 from /usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:5,
                 from /usr/include/linux/sched.h:9,
                 from test3.c:11:
/usr/include/linux/string.h:8:2: warning: #warning Using kernel header in userland!
In file included from /usr/include/linux/sched.h:14,
                 from test3.c:11:
/usr/include/linux/timex.h:173: error: field `time' has incomplete type
In file included from /usr/include/linux/bitops.h:69,
                 from /usr/include/asm/system.h:7,
                 from /usr/include/linux/sched.h:16,
                 from test3.c:11:
/usr/include/asm/bitops.h:327:2: warning: #warning This includefile is not available on all architectures.
/usr/include/asm/bitops.h:328:2: warning: #warning Using kernel headers in userspace: atomicity not guaranteed
In file included from /usr/include/linux/signal.h:4,
                 from /usr/include/linux/sched.h:25,
                 from test3.c:11:
/usr/include/asm/signal.h:107: error: parse error before "sigset_t"
/usr/include/asm/signal.h:110: error: parse error before '}' token
In file included from /usr/include/linux/sched.h:81,
                 from test3.c:11:
/usr/include/linux/timer.h:45: error: parse error before "spinlock_t"
/usr/include/linux/timer.h:53: error: parse error before '}' token
/usr/include/linux/timer.h:67: error: parse error before "tvec_base_t"
/usr/include/linux/timer.h:101: error: parse error before "tvec_bases"
/usr/include/linux/timer.h: In function `init_timer':
/usr/include/linux/timer.h:105: error: dereferencing pointer to incomplete type
/usr/include/linux/timer.h:105: error: dereferencing pointer to incomplete type
/usr/include/linux/timer.h:106: error: dereferencing pointer to incomplete type
/usr/include/linux/timer.h: In function `timer_pending':
/usr/include/linux/timer.h:121: error: dereferencing pointer to incomplete type
In file included from test3.c:13:
/usr/include/linux/malloc.h:3:2: warning: #warning The Use of linux/malloc.h is
deprecated, use linux/slab.h
test3.c:99:79: warning: no newline at end of file
test3.c: At top level:
test3.c:99: error: parse error at end of input
[root@localhost e-disk]#

怎么会是头文件报错呀,本人百思不得其解。
发表于 2005-3-30 08:56:24 | 显示全部楼层
感觉是不是少包含头文件了?
回复 支持 反对

使用道具 举报

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

本版积分规则

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