gnu在配置成功后出现错误
我正在尝试建立依赖于libtiff的'lcms2'静态库。 libtiff再次依赖于libjbig。我已成功配置libtest以下参数:gnu在配置成功后出现错误
CFLAGS="-fPIC" CXXFLAGS="-fPIC" LIBS="-ljbig" ./configure --prefix=/usr/local --enable-static=yes --enable-shared=no --with-zlib=yes --with-jpeg=yes --with-tiff=yes --with-pic=PIC
的配置报告没有错误:
checking for TIFF support ...
checking tiff.h usability... yes
checking tiff.h presence... yes
checking for tiff.h... yes
checking tiffio.h usability... yes
checking tiffio.h presence... yes
checking for tiffio.h... yes
checking for TIFFOpen in -ltiff... yes
checking for TIFFClientOpen in -ltiff... yes
checking for TIFFIsByteSwapped in -ltiff... yes
checking if TIFF package is complete... yes
checking tiffconf.h usability... yes
checking tiffconf.h presence... yes
checking for tiffconf.h... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating lcms2.pc
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating utils/tificc/Makefile
config.status: creating utils/transicc/Makefile
config.status: creating utils/linkicc/Makefile
config.status: creating utils/jpgicc/Makefile
config.status: creating utils/psicc/Makefile
config.status: creating testbed/Makefile
config.status: executing depfiles commands
config.status: executing libtool commands
的时候我让它引发以下错误库:
/bin/sh ../../libtool --tag=CC --mode=link gcc -std=gnu99 -fPIC -o tificc tificc.o xgetopt.o vprf.o ../../src/liblcms2.la -ltiff -ljpeg -lz -lm
libtool: link: gcc -std=gnu99 -fPIC -o tificc tificc.o xgetopt.o vprf.o ../../src/.libs/liblcms2.a -ltiff -ljpeg -lz -lm
/usr/local/lib/libtiff.a(tif_jbig.o): In function `JBIGDecode':
tif_jbig.c:(.text+0xc4): undefined reference to `jbg_dec_init'
tif_jbig.c:(.text+0xe4): undefined reference to `jbg_newlen'
tif_jbig.c:(.text+0x116): undefined reference to `jbg_dec_in'
tif_jbig.c:(.text+0x12a): undefined reference to `jbg_strerror'
tif_jbig.c:(.text+0x177): undefined reference to `jbg_dec_getimage'
tif_jbig.c:(.text+0x188): undefined reference to `jbg_dec_getsize'
tif_jbig.c:(.text+0x1ac): undefined reference to `jbg_dec_free'
/usr/local/lib/libtiff.a(tif_jbig.o): In function `JBIGEncode':
tif_jbig.c:(.text+0x402): undefined reference to `jbg_enc_init'
tif_jbig.c:(.text+0x40d): undefined reference to `jbg_enc_out'
tif_jbig.c:(.text+0x418): undefined reference to `jbg_enc_free'
collect2: ld returned 1 exit status
make[1]: *** [tificc] Error 1
libtool: link: gcc -std=gnu99 -fPIC -o tificc tificc.o xgetopt.o vprf.o ../../src/.libs/liblcms2.a -ltiff -ljpeg -lz -lm
在链接命令中没有提到JBIG库(我不记得应该在之前还是之后r - 某些库需要两者 - 对libtiff的引用,-ltiff
),所以jbg_*
引用无法解析。 LCMS链接并不能帮助你,因为JBIG没有被JBIG链接,而只被JBIG链接。
将-ljbig
添加到链接命令。或者,手动编辑Makefile并添加-ljbig到LIBS(例如。LIBS = -ljbig)。