scof007 scof007 - 1 year ago 289
C Question

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

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:

proc = proc_net_create(KAODV_QUEUE_PROC_FS_NAME, 0, kaodv_queue_get_info);
proc = create_proc_read_entry(KAODV_QUEUE_PROC_FS_NAME, 0, init_net.proc_net, kaodv_queue_get_info, NULL);
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

Answer Source

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>

Also: create_proc_read_entry is a deprecated function.

Take a look at:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download