mksquash_lzma-3.2 编译调试记录

今天在编译mksquash_lzma-3.2的时候出现了如下问题:

  1. /home/test/RT288x_SDK/toolchain/mksquash_lzma-3.2/lzma443/C/7zip/Compress/LZMA_C/libunlzma.a(uncomp.o):在函数‘sqlzma_un’中:
  2. uncomp.c:(.text+0x67):对‘inflateReset’未定义的引用
  3. uncomp.c:(.text+0xa7):对‘inflate’未定义的引用
  4. uncomp.c:(.text+0x1b2):对‘zError’未定义的引用
  5. /home/test/RT288x_SDK/toolchain/mksquash_lzma-3.2/lzma443/C/7zip/Compress/LZMA_C/libunlzma.a(uncomp.o):在函数‘sqlzma_init’中:
  6. uncomp.c:(.text+0x3f0):对‘inflateInit_’未定义的引用
  7. collect2: 错误: ld 返回 1
  8. 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文件,找到

  1. LDLIBS += -lz -L${LzmaAlone} -L${LzmaC}
LDLIBS += -lz -L${LzmaAlone} -L${LzmaC}
把 -lz 去掉,成:
  1. LDLIBS += -L${LzmaAlone} -L${LzmaC}
LDLIBS += -L${LzmaAlone} -L${LzmaC}

然后在找到包含LDLIBS的两行,后边添上 -lz 即可

  1. mksquashfs: LDLIBS += -lpthread -lunlzma_r -llzma_r -lstdc++ -lz
  2. unsquashfs: LDLIBS += -lunlzma -lz
mksquashfs: LDLIBS += -lpthread -lunlzma_r -llzma_r -lstdc++ -lz
unsquashfs: LDLIBS += -lunlzma -lz

./configure

make

make install

编译成功!

分享到:

posted @ 2013-09-18 22:39  miosec  阅读(1254)  评论(0编辑  收藏  举报