编译某基于 openwrt 的 sdk contents.c:(.text+0xbdd): undefined reference to `major'

http://blog.chinaunix.net/uid-20680966-id-5833778.html
https://blog.csdn.net/kuangzuxiaoN/article/details/121458746

最近编译某版本Openwrt,中途出现如下提示:

contents.o: In function make_special': contents.c:(.text+0xbdd): undefined reference to major'
contents.c:(.text+0xbfd): undefined reference to `minor'
collect2: error: ld returned 1 exit status
Makefile:24: recipe for target 'make_ext4fs' failed
make[4]: *** [make_ext4fs] Error 1

解决方法:

找到源码目录下build_dir/host/下,其中make-ex4fs-XXX(日期)文件夹,找到contents.c,编辑,在头文件引入中加入

#include <sys/sysmacros.h>

即可

posted @ 2022-03-11 18:08  Juwan  阅读(403)  评论(0编辑  收藏  举报