budesh 发表于 2012-09-19 13:25

驱动程序编译时提示内核不匹配

驱动程序编译时提示内核不匹配
驱动程序为
#include <linux/module.h> //所有模块都需要的头文件
#include <linux/init.h> // init&exit 相关宏
MODULE_LICENSE("GPL");
static int __init hello_init (void)
{
printk("Hello module init\n");
return 0;
}
static void __exit hello_exit (void)
{
printk("Hello module exit\n");
3
}
module_init(hello_init);
module_exit(hello_exit);


makefile编译内容为
gcc –D__KERNEL__ -DMODULE –DLINUX –I /usr/local/src/linux2.4/include -c –o hello.o
hello.c

错误提示为:kernel-module version dismatch
               hello.o was compiled for kernel version 2.4.20
            while this kernel is version 2.4.20-8.   

求众位大侠指导

T-Bagwell 发表于 2012-09-19 15:34

指定的KDIR目录不对

budesh 发表于 2012-09-20 10:52

谢版主指导了   
页: [1]
查看完整版本: 驱动程序编译时提示内核不匹配