【问题标题】:error: implicit declaration of function ‘create_proc_entry’错误:函数‘create_proc_entry’的隐式声明
【发布时间】:2015-09-27 09:43:29
【问题描述】:

内核版本:3.13.0-32-generic

当我构建模块时出现错误

make -C /lib/modules/3.13.0-32-generic/build M=/home/wipro/Downloads/proc modules make[1]: 进入目录 /usr/src/linux-headers-3.13.0-32-generic' CC [M] /home/wipro/Downloads/proc/proc.o /home/wipro/Downloads/proc/proc.c: In function ‘proc_win_init’: /home/wipro/Downloads/proc/proc.c:21:5: error: implicit declaration of function ‘create_proc_entry’ [-Werror=implicit-function-declaration] if ((file = create_proc_entry("rel_time", 0666, parent)) == NULL) { ^ /home/wipro/Downloads/proc/proc.c:21:15: warning: assignment makes pointer from integer without a cast [enabled by default] if ((file = create_proc_entry("rel_time", 0666, parent)) == NULL) { ^ /home/wipro/Downloads/proc/proc.c:25:9: error: dereferencing pointer to incomplete type file->read_proc = time_read; ^ /home/wipro/Downloads/proc/proc.c:26:9: error: dereferencing pointer to incomplete type file->write_proc = time_write; ^ /home/wipro/Downloads/proc/proc.c:32:9: error: dereferencing pointer to incomplete type link->uid = 0; ^ /home/wipro/Downloads/proc/proc.c:33:9: error: dereferencing pointer to incomplete type link->gid = 100; ^ cc1: some warnings being treated as errors make[2]: *** [/home/wipro/Downloads/proc/proc.o] Error 1 make[1]: *** [_module_/home/wipro/Downloads/proc] Error 2 make[1]: Leaving directory/usr/src/linux-headers-3.13.0-32-generic' 品牌:*** [默认] 错误 2

如何消除错误

【问题讨论】:

标签: linux kernel linux-device-driver


【解决方案1】:

create_proc_entry 自 3.10 内核版本以来已被删除。另一种方法是使用proc_create。请参阅question 了解更多信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-20
    • 2018-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多