我正在编译(&链接)我的Linux驱动程序代码,并在模块链接时得到以下错误。我试图检查我的Makefile是否有任何潜在的错误(制表符、空格等)。但是,它几乎用于我的其他内核模块编程,而且工作正常。任何一种poi
Src模块:
Makefile:
obj-m += static_waitqueue_driver.c
KDIR =/lib/模块/$(shell uname -r)/build
全部:制作-C $(KDIR) M=$(外壳pwd)模块
清洁:使-C $(KDIR) M=$(外壳pwd)清洁
错误:
用户:苏丹树主机:UbuntuVirtualBox日期:2001年4月3日
时间:13:23:36 24 ~/tmp/01_linux_learning/10_wait_queue $ make -C /lib/ modules /5.3.0-28-泛型/构建-C模块make1:输入目录‘/usr/src/linux-报头-5.3.0-28-泛型’
建筑单元,第2阶段:脚本/Makefile.modpost:113:目标'/home/sudhanshu/tmp/01_linux_learning/10_wait_queue/static_waitqueue_driver.c‘不匹配目标模式脚本/Makefile.modpost:114:警告:重写目标'/home/sudhanshu/tmp/01_linux_learning/10_wait_queue/static_waitqueue_driver.c’脚本的配方/Makefile.modpost:101:警告:忽略目标'/home/sudhanshu/tmp/01_linux_learning/10_wait_queue/static_waitqueue_driver.c‘脚本/makefile.modpost:128:'/home/sudhanshu/tmp/01_linux_learning/10_wait_queue/static_waitqueue_driver.c’不匹配目标模式脚本/Makefile.modpost:129:警告:重写目标'/home/sudhanshu/tmp/01_linux_learning/10_wait_queue/static_waitqueue_driver.c‘脚本/Makefile.modpost:114:警告:忽略目标'/home/sudhanshu/tmp/01_linux_learning/10_wait_queue/static_waitqueue_driver.c‘MODPOST 1模块的旧配方LD M /home/sudhanshu/tmp/01_linux_learning/10_wait_queue/static_waitqueue_driver.c ld:无输入文件脚本/Makefile.modpost:129:'/home/sudhanshu/tmp/01_linux_learning/10_wait_queue/static_waitqueue_driver.c’配方失败make2:E13模块错误2 make1:离开目录‘/usr/src/linux-headers 5.3.0-28-泛型’Makefile:6:目标' all‘failed make1:*all Error 2
发布于 2022-02-16 07:28:59
将此行更改为:
obj-m += static_waitqueue_driver.c
至:
obj-m += static_waitqueue_driver.o
https://stackoverflow.com/questions/60966291
复制相似问题