LDD 例子代码编译出错,出错信息如下,请求大侠指点。谢谢!

findfriend 2018-06-22 03:45:59
make -C /lib/modules/4.13.0-36-generic/build M=/home/kdt/LDD/ch8 modules
make[1]: Entering directory '/usr/src/linux-headers-4.13.0-36-generic'
CC [M] /home/kdt/LDD/ch8/globalfifo.o
/home/kdt/LDD/ch8/globalfifo.c: In function ‘globalfifo_read’:
/home/kdt/LDD/ch8/globalfifo.c:108:7: error: implicit declaration of function ‘signal_pending’ [-Werror=implicit-function-declaration]
if (signal_pending(current)) {
^
In file included from ./include/linux/printk.h:6:0,
from ./include/linux/kernel.h:13,
from ./include/linux/list.h:8,
from ./include/linux/module.h:9,
from /home/kdt/LDD/ch8/globalfifo.c:9:
./include/linux/kern_levels.h:4:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
./include/linux/kern_levels.h:13:19: note: in expansion of macro ‘KERN_SOH’
#define
...全文
971 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
bigPillow 2018-07-17
  • 打赏
  • 举报
回复
引用 3 楼 qq_36751214 的回复:
这不提示了吗?不兼容,编译额时候加上-Werror=implicit-function-declaration 试试,


-Wno-implicit-function-declaration?
枫叶雪 2018-07-02
  • 打赏
  • 举报
回复
根据报错信息,你的内核版本是4.13.0 。这对于LDD3中的例程来说太新了。LDD3代码的时代,我印象里是内核2.X;我当时参照3.18.24的内核看的,就已经有很多函数/结构体不同了。
除非有对应版本的内核,否则不建议去编译LDD3的例程(因为内核版本不同,根本编不过)
我曾经看的时候,书中的接口,都是去较新的内核代码中去找找,学习一下新的怎么用。LDD3对于现在来说,内容还是不错的,就是老了点~
宁南学者 2018-06-27
  • 打赏
  • 举报
回复
这不提示了吗?不兼容,编译额时候加上-Werror=implicit-function-declaration 试试,
jklinux 2018-06-25
  • 打赏
  • 举报
回复
#include <linux/sched.h>

包含此头文件试下
aabbabababaa 2018-06-23
  • 打赏
  • 举报
回复
几个错误啊,没用过LDD,来学习下

1,318

社区成员

发帖
与我相关
我的任务
社区描述
主要是开发驱动技术
社区管理员
  • 驱动程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧