sunsili 发表于 2023-7-7 16:35:07

【openwrt】编译OpenWRT 出错unsquashfs undefined reference to makedev解...

本帖最后由 sunsili 于 2023-7-7 17:13 编辑

【openwrt】编译OpenWRT 15.05(Chaos Calmer CC)出错unsquashfs undefined reference to makedev解决方法

现象
出错提示:
gcc   unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o swap.o compressor.o gzip_wrapper.o lzma_xz_wrapper.o xz_wrapper.o lzma_xz_options.o /home/fan/openwrt_CC_mt76xx_omj_source/staging_dir/host/lib/liblzma.a -lpthread -lm -lz -o unsquashfs
/usr/bin/ld: unsquashfs.o: in function create_inode': unsquashfs.c:(.text+0x24dc): undefined reference to makedev'
collect2: error: ld returned 1 exit status
make: *** Error 1
make: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source/build_dir/host/squashfs4.2/squashfs-tools'
make: *** Error 2
make: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source/tools/squashfs4'
make: *** Error 2
make: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source'
make: *** Error 2
make: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source'
make: *** Error 2

解决方法
修改:
vim build_dir/host/squashfs4.2/squashfs-tools/unsquashfs.c
在代码头部添加
#include <sys/sysmacros.h>


页: [1]
查看完整版本: 【openwrt】编译OpenWRT 出错unsquashfs undefined reference to makedev解...