Ubuntu下的模块编程
-
- 帖子: 13
- 注册时间: 2007-07-10 10:27
Ubuntu下的模块编程
写了 个简单的模块程序,想在ubuntu6.10下看下运行结果,编译后总是提示没有头文件,不知道什么问题,在ubuntu下写模块程序还需要什么具体的操作呢?高手赐教。安装后的ubuntu的源代码在哪里可以找到阿?
-
- 帖子: 13
- 注册时间: 2007-07-10 10:27
以下是错误提示:
dr.c:1:27: error: linux/module.h: No such file or directory
dr.c:3:27: error: linux/config.h: No such file or directory
dr.c:5:25: error: linux/init.h: No such file or directory
dr.c:7: error: expected declaration specifiers or ‘...’ before string constant
dr.c:7: warning: data definition has no type or storage class
dr.c: In function ‘hello_init’:
dr.c:13: error: ‘KERN_ALERT’ undeclared (first use in this function)
dr.c:13: error: (Each undeclared identifier is reported only once
dr.c:13: error: for each function it appears in.)
dr.c:13: error: expected ‘)’ before string constant
dr.c: In function ‘hello_exit’:
dr.c:23: error: ‘KERN_ALERT’ undeclared (first use in this function)
dr.c:23: error: expected ‘)’ before string constant
dr.c: At top level:
dr.c:27: warning: data definition has no type or storage class
dr.c:27: warning: parameter names (without types) in function declaration
dr.c:29: warning: data definition has no type or storage class
dr.c:29: warning: parameter names (without types) in function declaration
dr.c:1:27: error: linux/module.h: No such file or directory
dr.c:3:27: error: linux/config.h: No such file or directory
dr.c:5:25: error: linux/init.h: No such file or directory
dr.c:7: error: expected declaration specifiers or ‘...’ before string constant
dr.c:7: warning: data definition has no type or storage class
dr.c: In function ‘hello_init’:
dr.c:13: error: ‘KERN_ALERT’ undeclared (first use in this function)
dr.c:13: error: (Each undeclared identifier is reported only once
dr.c:13: error: for each function it appears in.)
dr.c:13: error: expected ‘)’ before string constant
dr.c: In function ‘hello_exit’:
dr.c:23: error: ‘KERN_ALERT’ undeclared (first use in this function)
dr.c:23: error: expected ‘)’ before string constant
dr.c: At top level:
dr.c:27: warning: data definition has no type or storage class
dr.c:27: warning: parameter names (without types) in function declaration
dr.c:29: warning: data definition has no type or storage class
dr.c:29: warning: parameter names (without types) in function declaration
-
- 帖子: 99
- 注册时间: 2005-12-20 17:06
-
- 帖子: 34
- 注册时间: 2007-12-23 12:22
- BigSnake.NET
- 帖子: 12522
- 注册时间: 2006-07-02 11:16
- 来自: 廣州
- 联系: