今天在编译mksquash_lzma-3.2的时候出现了如下问题:
- /home/test/RT288x_SDK/toolchain/mksquash_lzma-3.2/lzma443/C/7zip/Compress/LZMA_C/libunlzma.a(uncomp.o):在函数‘sqlzma_un’中:
- uncomp.c:(.text+0x67):对‘inflateReset’未定义的引用
- uncomp.c:(.text+0xa7):对‘inflate’未定义的引用
- uncomp.c:(.text+0x1b2):对‘zError’未定义的引用
- /home/test/RT288x_SDK/toolchain/mksquash_lzma-3.2/lzma443/C/7zip/Compress/LZMA_C/libunlzma.a(uncomp.o):在函数‘sqlzma_init’中:
- uncomp.c:(.text+0x3f0):对‘inflateInit_’未定义的引用
- collect2: 错误: ld 返回 1
- make[1]: *** [unsquashfs] 错误 1
/home/test/RT288x_SDK/toolchain/mksquash_lzma-3.2/lzma443/C/7zip/Compress/LZMA_C/libunlzma.a(uncomp.o):在函数‘sqlzma_un’中:
uncomp.c:(.text+0x67):对‘inflateReset’未定义的引用
uncomp.c:(.text+0xa7):对‘inflate’未定义的引用
uncomp.c:(.text+0x1b2):对‘zError’未定义的引用
/home/test/RT288x_SDK/toolchain/mksquash_lzma-3.2/lzma443/C/7zip/Compress/LZMA_C/libunlzma.a(uncomp.o):在函数‘sqlzma_init’中:
uncomp.c:(.text+0x3f0):对‘inflateInit_’未定义的引用
collect2: 错误: ld 返回 1
make[1]: *** [unsquashfs] 错误 1
首先,需要确保安装了zlib库。zlib1g,zlib1g-dbg,zlib1g-dev
其次,打开安装目录下的squashfs3.2-r2/squashfs-tools,找到Makefile文件,找到
- LDLIBS += -lz -L${LzmaAlone} -L${LzmaC}
LDLIBS += -lz -L${LzmaAlone} -L${LzmaC}
把 -lz 去掉,成:
- LDLIBS += -L${LzmaAlone} -L${LzmaC}
LDLIBS += -L${LzmaAlone} -L${LzmaC}
然后在找到包含LDLIBS的两行,后边添上 -lz 即可
- mksquashfs: LDLIBS += -lpthread -lunlzma_r -llzma_r -lstdc++ -lz
- unsquashfs: LDLIBS += -lunlzma -lz
mksquashfs: LDLIBS += -lpthread -lunlzma_r -llzma_r -lstdc++ -lz
unsquashfs: LDLIBS += -lunlzma -lz
./configure
make
make install
编译成功!
分享到: