当前位置: 技术问答>linux和unix
一个linux设备驱动程序书里源代码编译的问题
来源: 互联网 发布时间:2015-07-02
本文导语: 一个linux设备驱动程序书里源代码编译的问题 #define MODULE #include int init_module(void) { printk("Hello, worldn"); return 0; } void cleanup_module(void) { printk("Goodbye cruel worldn"); } helo.c:4:65: warning: no newline at end of file ...
一个linux设备驱动程序书里源代码编译的问题
#define MODULE
#include
int init_module(void) { printk("Hello, worldn"); return 0; }
void cleanup_module(void) { printk("Goodbye cruel worldn"); }
helo.c:4:65: warning: no newline at end of file
In file included from helo.c:2:
/usr/include/linux/module.h:60: parse error before `atomic_t'
/usr/include/linux/module.h:60: warning: no semicolon at end of struct or union
/usr/include/linux/module.h:60: warning: no semicolon at end of struct or union
/usr/include/linux/module.h:62: parse error before `}'
/usr/include/linux/module.h:62: warning: data definition has no type or storage class
/usr/include/linux/module.h:91: parse error before `}'
编译出这个问题
我的系统是redhat 7.3 内核是2.4.18
#define MODULE
#include
int init_module(void) { printk("Hello, worldn"); return 0; }
void cleanup_module(void) { printk("Goodbye cruel worldn"); }
helo.c:4:65: warning: no newline at end of file
In file included from helo.c:2:
/usr/include/linux/module.h:60: parse error before `atomic_t'
/usr/include/linux/module.h:60: warning: no semicolon at end of struct or union
/usr/include/linux/module.h:60: warning: no semicolon at end of struct or union
/usr/include/linux/module.h:62: parse error before `}'
/usr/include/linux/module.h:62: warning: data definition has no type or storage class
/usr/include/linux/module.h:91: parse error before `}'
编译出这个问题
我的系统是redhat 7.3 内核是2.4.18
|
#define MODULE
#define __KERNEL__
#include
#include
#include
我是这样定义的,你参考一下
#define __KERNEL__
#include
#include
#include
我是这样定义的,你参考一下