level 4
Austin丁
楼主
这是原码
#include
#if defined(CONFIG_SMP)
#define _SMP_#
endif
#if defined(CONFIG_MODVERSIONS)#define MODVERSIONS#include #endif
#include
static _init int init_module(void){ printk(KERN_DEBUG "HELLO,KERNEL!\"); return 0;}
static _exit void cleanup_module(void){ printk(KERN_DEBUG "GOOD-BYE,kernel!\n");}
这是编译语句
gcc -D_KERNEL_ -I/usr/src/linux/include -DMODULE -Wall -O2 -c hello_kernel.c -o hello_kernel.o
出错的提示
hello_kernel.c:1:25: fatal error: linux/module.h: No such file or directorycompilation terminated.
2013年05月20日 14点05分
1
#include
#if defined(CONFIG_SMP)
#define _SMP_#
endif
#if defined(CONFIG_MODVERSIONS)#define MODVERSIONS#include #endif
#include
static _init int init_module(void){ printk(KERN_DEBUG "HELLO,KERNEL!\"); return 0;}
static _exit void cleanup_module(void){ printk(KERN_DEBUG "GOOD-BYE,kernel!\n");}
这是编译语句
gcc -D_KERNEL_ -I/usr/src/linux/include -DMODULE -Wall -O2 -c hello_kernel.c -o hello_kernel.o
出错的提示
hello_kernel.c:1:25: fatal error: linux/module.h: No such file or directorycompilation terminated.