create报错不是函数_错误:函数“create_proc_read_entry'[-Werror =隐函数声明]的隐式声明...

I'm trying to compile a kernel module on kernel 3.13 and I get this error:

error: implicit declaration of function 'create_proc_read_entry' [-Werror=implicit-function-declaration]

I google it and did not found any response. Here is the part of the code which refers to this error:

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))

proc = proc_net_create(KAODV_QUEUE_PROC_FS_NAME, 0, kaodv_queue_get_info);

#else

proc = create_proc_read_entry(KAODV_QUEUE_PROC_FS_NAME, 0, init_net.proc_net, kaodv_queue_get_info, NULL);

#endif

if (!proc) {

printk(KERN_ERR "kaodv_queue: failed to create proc entry\n");

return -1;

}

Can I get help ? I really don't know what is wrong. It might be the kernel 3.13 which needs a patch. I read somewhere (on KERNEL 3.10) that the kernel needs patch. Can anyone show me where can I get the 3.13 kernel patch to eventually fix the problem. Thanks

解决方案

The error is because you are not including explicitly the header that declares the function and the compiler is 'including' implicitily for you and this throws a warning. The flag '-Werror' is making the compiler treats the warning as an error. Try adding: #include

Also: create_proc_read_entry is a deprecated function.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值