Page 1 of 1

编译驱动驱动时显示缺少头文件

Posted: 2025-03-11 7:30
by fongsera
在编译官方提供的应用示例时显示
./include/uapi/asm-generic/int-ll64.h:12:10: fatal error: asm/bitsperlong.h: No such file or directory
#include <asm/bitsperlong.h>
^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:273: /home/ubuntu/plus/hello/helloworld.o] Error 1
make[1]: *** [Makefile:1935: /home/ubuntu/plus/hello] Error 2
make[1]: Leaving directory '/home/ubuntu/plus/luckfox-pico/sysdrv/source/kernel'
关于FAQ17第二条提到的办法试过,但无济于事。
尝试过修改KDIR:=/home/ubuntu/plus/luckfox-pico/sysdrv/source/kernel为KDIR:=/home/ubuntu/plus/luckfox-pico/sysdrv/source/objs_kernel。但是提示缺少另外一个头文件asm/tlbbatch.h

Re: 编译驱动驱动时显示缺少头文件

Posted: 2025-03-11 11:07
by Crocodile
您好,KDIR要指向内核源码的地址,应该时 /home/ubuntu/plus/luckfox-pico/sysdrv/source/kernel KBUILD_OUTPUT 要指向内核编译的输出地址应该是 /home/ubuntu/plus/luckfox-pico/sysdrv/source/objs_kernel, wiki的示例实测是没有问题的,请检查Makefile是否配置正确