TIFF 库中未定义的引用
Undefined references in TIFF library
我正在尝试为 arm 编译 Panotools。我编译了所有依赖库(TIFF、ZLIB、JPEG),但 Panotools 的 configure
在 libtiff 上失败:
checking for TIFF support ...
configure: tiff home set to /usr/local
checking tiff.h usability... yes
checking tiff.h presence... yes
checking for tiff.h... yes
checking for TIFFOpen in -ltiff... no
checking if TIFF package is complete... no -- some components failed test
configure: error:
the tiff library must be installed on your system
but configure could not find it.
如您所见,它可以找到 tiff.h
,并且在 config.log
中查找似乎也找到了库,但由于某些未定义的引用而失败。这是一些日志:
configure:12446: checking for TIFFOpen in -ltiff
configure:12471: arm-linux-gnueabihf-gcc -o conftest -g -O2 -IC:\tiff-3.9.4\libtiff -IC:\PROGRA~2\GnuWin32\src\libjpeg\jpeg-6b -I/usr/local/include -L/usr/local/lib conftest.c -ltiff -lz -ljpeg -LC:\tiff-3.9.4\libtiff\.libs -LC:\tiff-3.9.4\port\.libs -LC:/PROGRA~2/GnuWin32/src/libjpeg/jpeg-6b >&5
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_aux.o): In function `TIFFDefaultTransferFunction':
c:\tiff-3.9.4\libtiff/tif_aux.c:81: undefined reference to `pow'
c:\tiff-3.9.4\libtiff/tif_aux.c:81: undefined reference to `floor'
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_luv.o): In function `oog_encode':
c:\tiff-3.9.4\libtiff/tif_luv.c:776: undefined reference to `atan2'
c:\tiff-3.9.4\libtiff/tif_luv.c:803: undefined reference to `atan2'
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_luv.o): In function `LogL16toY':
c:\tiff-3.9.4\libtiff/tif_luv.c:657: undefined reference to `exp'
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_luv.o): In function `L16toGry':
c:\tiff-3.9.4\libtiff/tif_luv.c:696: undefined reference to `sqrt'
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_luv.o): In function `LogL16fromY':
c:\tiff-3.9.4\libtiff/tif_luv.c:672: undefined reference to `log'
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_luv.o): In function `XYZtoRGB24':
c:\tiff-3.9.4\libtiff/tif_luv.c:725: undefined reference to `sqrt'
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_pixarlog.o):c:\tiff-3.9.4\libtiff/tif_pixarlog.c:901: more undefined references to `log' follow
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_pixarlog.o): In function `PixarLogMakeTables':
c:\tiff-3.9.4\libtiff/tif_pixarlog.c:541: undefined reference to `exp'
collect2.exe: error: ld returned 1 exit status
configure:12471: $? = 1
configure: failed program was:
| ...
|
| /* Override any GCC internal prototype to avoid an error.
| Use char because int might match the return type of a GCC
| builtin and then its argument prototype would still apply. */
| #ifdef __cplusplus
| extern "C"
| #endif
| char TIFFOpen ();
| int
| main ()
| {
| return TIFFOpen ();
| ;
| return 0;
| }
configure:12480: result: no
Here someone's having the same problem but due to a different reason (libtiff can't be found at all). And here it says that jbig
is a dependency library for libtiff
so I tried including it for the compiler (although here 它没有作为依赖库被提及)并且没有任何改变。
为什么我会收到那些未定义的引用?这些符号在哪里定义的?我需要将任何库添加到链接器吗?
所有这些未定义的引用都属于库 math
所以只需要为链接器包含它。当运行 configure
:
时将此添加到编译命令
LDFLAGS=-lm
我正在尝试为 arm 编译 Panotools。我编译了所有依赖库(TIFF、ZLIB、JPEG),但 Panotools 的 configure
在 libtiff 上失败:
checking for TIFF support ...
configure: tiff home set to /usr/local
checking tiff.h usability... yes
checking tiff.h presence... yes
checking for tiff.h... yes
checking for TIFFOpen in -ltiff... no
checking if TIFF package is complete... no -- some components failed test
configure: error:
the tiff library must be installed on your system
but configure could not find it.
如您所见,它可以找到 tiff.h
,并且在 config.log
中查找似乎也找到了库,但由于某些未定义的引用而失败。这是一些日志:
configure:12446: checking for TIFFOpen in -ltiff
configure:12471: arm-linux-gnueabihf-gcc -o conftest -g -O2 -IC:\tiff-3.9.4\libtiff -IC:\PROGRA~2\GnuWin32\src\libjpeg\jpeg-6b -I/usr/local/include -L/usr/local/lib conftest.c -ltiff -lz -ljpeg -LC:\tiff-3.9.4\libtiff\.libs -LC:\tiff-3.9.4\port\.libs -LC:/PROGRA~2/GnuWin32/src/libjpeg/jpeg-6b >&5
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_aux.o): In function `TIFFDefaultTransferFunction':
c:\tiff-3.9.4\libtiff/tif_aux.c:81: undefined reference to `pow'
c:\tiff-3.9.4\libtiff/tif_aux.c:81: undefined reference to `floor'
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_luv.o): In function `oog_encode':
c:\tiff-3.9.4\libtiff/tif_luv.c:776: undefined reference to `atan2'
c:\tiff-3.9.4\libtiff/tif_luv.c:803: undefined reference to `atan2'
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_luv.o): In function `LogL16toY':
c:\tiff-3.9.4\libtiff/tif_luv.c:657: undefined reference to `exp'
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_luv.o): In function `L16toGry':
c:\tiff-3.9.4\libtiff/tif_luv.c:696: undefined reference to `sqrt'
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_luv.o): In function `LogL16fromY':
c:\tiff-3.9.4\libtiff/tif_luv.c:672: undefined reference to `log'
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_luv.o): In function `XYZtoRGB24':
c:\tiff-3.9.4\libtiff/tif_luv.c:725: undefined reference to `sqrt'
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_pixarlog.o):c:\tiff-3.9.4\libtiff/tif_pixarlog.c:901: more undefined references to `log' follow
C:/MinGW/msys/1.0/local/lib\libtiff.a(tif_pixarlog.o): In function `PixarLogMakeTables':
c:\tiff-3.9.4\libtiff/tif_pixarlog.c:541: undefined reference to `exp'
collect2.exe: error: ld returned 1 exit status
configure:12471: $? = 1
configure: failed program was:
| ...
|
| /* Override any GCC internal prototype to avoid an error.
| Use char because int might match the return type of a GCC
| builtin and then its argument prototype would still apply. */
| #ifdef __cplusplus
| extern "C"
| #endif
| char TIFFOpen ();
| int
| main ()
| {
| return TIFFOpen ();
| ;
| return 0;
| }
configure:12480: result: no
Here someone's having the same problem but due to a different reason (libtiff can't be found at all). And here it says that jbig
is a dependency library for libtiff
so I tried including it for the compiler (although here 它没有作为依赖库被提及)并且没有任何改变。
为什么我会收到那些未定义的引用?这些符号在哪里定义的?我需要将任何库添加到链接器吗?
所有这些未定义的引用都属于库 math
所以只需要为链接器包含它。当运行 configure
:
LDFLAGS=-lm