gzcgh
驱动牛犊
驱动牛犊
  • 注册日期2002-06-24
  • 最后登录2003-06-21
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1805回复:5

为什么在2.4.10可通过编译,而在2.4.18就不行了???

楼主#
更多 发布于:2003-06-05 11:25
有一个模块,在linux7.2,内核为2.4.10下,可以顺利编译。而在linux8.0,内核为2.4.18下,就不行了而且报下面的错。
求求各位帮帮忙啦~~~~~~~~~~

[root@localhost ex]# gcc -O2 -DMODULE -D__KERNEL__ -c op_com.c
In file included from /usr/include/linux/fs.h:23,
                 from op_com.c:28:
/usr/include/linux/string.h:8:2: warning: #warning Using kernel header in userla
nd!
In file included from /usr/include/linux/sched.h:14,
                 from /usr/include/linux/mm.h:4,
                 from op_com.c:29:
/usr/include/linux/timex.h:173: 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 /usr/include/linux/mm.h:4,
                 from op_com.c:29:
/usr/include/asm/bitops.h:333:2: warning: #warning This includefile is not avail
able on all architectures.
/usr/include/asm/bitops.h:334:2: warning: #warning Using kernel headers in users
pace.
In file included from /usr/include/linux/signal.h:4,
                 from /usr/include/linux/sched.h:25,
                 from /usr/include/linux/mm.h:4,
                 from op_com.c:29:
/usr/include/asm/signal.h:107: parse error before \"sigset_t\"
/usr/include/asm/signal.h:110: parse error before \'}\' token
In file included from /usr/include/linux/sched.h:81,
                 from /usr/include/linux/mm.h:4,
                 from op_com.c:29:
/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
op_com.c:32:25: asm/uaccess.h: No such file or directory
op_com.c: At top level:
op_com.c:38: warning: `struct file\' declared inside parameter list
op_com.c:38: warning: its scope is only this definition or declaration, which is
 probably not what you want
op_com.c: In function `read_test\':
op_com.c:42: `VERIFY_WRITE\' undeclared (first use in this function)
op_com.c:42: (Each undeclared identifier is reported only once
op_com.c:42: for each function it appears in.)
op_com.c: At top level:
op_com.c:53: warning: `struct file\' declared inside parameter list
op_com.c: In function `write_test\':
op_com.c:58: `VERIFY_WRITE\' undeclared (first use in this function)
op_com.c: At top level:
op_com.c:234: warning: `struct file\' declared inside parameter list
op_com.c:234: warning: `struct inode\' declared inside parameter list
op_com.c: In function `open_test\':
op_com.c:236: union has no member named `usecount\'
op_com.c: At top level:
op_com.c:240: warning: `struct file\' declared inside parameter list
op_com.c:240: warning: `struct inode\' declared inside parameter list
op_com.c: In function `release_test\':
op_com.c:243: union has no member named `usecount\'
op_com.c: At top level:
op_com.c:247: warning: `struct file\' declared inside parameter list
op_com.c:247: warning: `struct inode\' declared inside parameter list
op_com.c: In function `lseek_test\':
op_com.c:249: dereferencing pointer to incomplete type
op_com.c: At top level:
op_com.c:253: variable `test_fops\' has initializer but incomplete type
op_com.c:254: unknown field `owner\' specified in initializer
op_com.c:254: warning: excess elements in struct initializer
op_com.c:254: warning: (near initialization for `test_fops\')
op_com.c:255: unknown field `llseek\' specified in initializer
op_com.c:255: warning: excess elements in struct initializer
op_com.c:255: warning: (near initialization for `test_fops\')
op_com.c:256: unknown field `read\' specified in initializer
op_com.c:256: warning: excess elements in struct initializer
op_com.c:256: warning: (near initialization for `test_fops\')
op_com.c:257: unknown field `write\' specified in initializer
op_com.c:257: warning: excess elements in struct initializer
op_com.c:257: warning: (near initialization for `test_fops\')
op_com.c:258: unknown field `ioctl\' specified in initializer
op_com.c:258: warning: excess elements in struct initializer
op_com.c:258: warning: (near initialization for `test_fops\')
op_com.c:259: unknown field `open\' specified in initializer
op_com.c:259: warning: excess elements in struct initializer
op_com.c:259: warning: (near initialization for `test_fops\')
op_com.c:260: unknown field `release\' specified in initializer
op_com.c:260: warning: excess elements in struct initializer
op_com.c:260: warning: (near initialization for `test_fops\')
op_com.c: In function `init_module\':
op_com.c:276: `KERN_INFO\' undeclared (first use in this function)
op_com.c:276: parse error before string constant
/usr/include/linux/timer.h: At top level:
op_com.c:253: storage size of `test_fops\' isn\'t known
[root@localhost ex]#
[root@localhost ex]#
hust_sailor
驱动牛犊
驱动牛犊
  • 注册日期2002-07-10
  • 最后登录2018-05-29
  • 粉丝0
  • 关注0
  • 积分2分
  • 威望10点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2003-06-10 17:19
在哪个地方加???多谢
jjs
jjs
驱动牛犊
驱动牛犊
  • 注册日期2001-06-12
  • 最后登录2004-06-01
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2003-06-05 12:27
 呵呵,搞定就给分吧
gzcgh
驱动牛犊
驱动牛犊
  • 注册日期2002-06-24
  • 最后登录2003-06-21
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地板#
发布于:2003-06-05 11:54
OK!!
when compiling, i add a include to \"/usr/src/linux-2.4.18-14\",and it is ok now!!


thanks!!!
gzcgh
驱动牛犊
驱动牛犊
  • 注册日期2002-06-24
  • 最后登录2003-06-21
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2003-06-05 11:38
but in my linux, it is linux-2.4.18-14 already....

[编辑 -  6/5/03 by  gzcgh]
jjs
jjs
驱动牛犊
驱动牛犊
  • 注册日期2001-06-12
  • 最后登录2004-06-01
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2003-06-05 11:33
look  at   your include path
/usr/src/linux-2.4.18-10 should  be changed to    /usr/src/linux-2.4.18-14
bless!
游客

返回顶部