问题描述
我试图编译内核模块内核3.13我得到这个错误:
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]
我google一下,并没有发现任何回应。这里是code是指此错误的部分:
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;
}
我可以得到帮助吗?我真的不知道什么是错。这可能是一个需要补丁内核3.13。我读的地方(内核3.10)的内核需要修补。谁能告诉我我在哪里可以得到3.13内核补丁,以最终解决问题。谢谢
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
推荐答案
这个错误是因为你没有明确包括声明函数的头和编译器包括implicitily你和这将引发一个警告。标志'-Werror'正使编译器将警告作为错误。尝试添加:的#include&LT; Linux的/ proc_fs.h&GT;
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 <linux/proc_fs.h>
另外: create_proc_read_entry
是一个去precated功能。
Also: create_proc_read_entry
is a deprecated function.
看看:
这篇关于错误:函数“create_proc_read_entry'[-Werror =隐函数声明]的隐式声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!