Undefined reference errors and libtool
Pereira, Ricardo Scachetti
rpereira@ku.edu
Wed Jul 14 02:58:00 GMT 2004
Hello,
Maybe someone from the list can help me out.
I'm trying to build a project that contains a number of executables, static and shared
libraries using cygwin/autotools, but I'm having trouble with libtool.
At certain point during the build, the linker returns an undefined reference error:
../lib/.libs/libopenmodeller.a(libenv_io_la-raster_gdal.o)(.text+0xa59): In function
`_ZN10RasterGdal6createEPcR6Header':
/home/ricardo/wcs/modeller/src/lib/env_io/raster_gdal.cpp:217: undefined reference to
`_GetGDALDriverManager'
The command that generated this error is:
/bin/bash ../../libtool --mode=link g++ -g -O2 -o om_console.exe om_console-om_console.o
om_console-occurrences_file.o om_console-request_file.o -L/usr/local/lib -lgdal
../lib/libopenmodeller.la
which in turn runs this:
g++ -g -O2 -o om_console.exe om_console-om_console.o om_console-occurrences_file.o
om_console-request_file.o -L/usr/local/lib /usr/local/lib/libgdal.dll.a /usr/lib/libjpeg.dll.a
-ltiff -lpng -lz -L/usr/lib -lpq ../lib/.libs/libopenmodeller.a -L/usr/local/lib -L/usr/local/lib
Not sure why gcc doesn't find the symbols in libgdal.dll.a. nm says the symbol is there:
ricardo@testudo <mailto:ricardo@testudo> ~/wcs/modeller/src/console
$ nm /usr/local/lib/libgdal.dll.a | grep _GetGDALDriverManager
00000000 T _GetGDALDriverManager
00000000 I __imp__GetGDALDriverManager
If I replace the library "/usr/local/lib/libgdal.dll.a" in the command above by "-lgdal", I get
my executable compiled.
The problem does not happen when I compile the application on a Linux box.
Does anyone know what seems to be the problem in my setup?
Any help would be greatly appreciated.
Regards,
Ricardo
PS. Here is my system info:
Cygwin DLL version info:
DLL version: 1.5.10
ricardo@testudo <mailto:ricardo@testudo> ~/pkgs/gdal
$ cygcheck --sysinfo | grep autoconf
autoconf 2.59-1
autoconf-devel 2.59-1
autoconf-stable 2.13-5
ricardo@testudo <mailto:ricardo@testudo> ~/pkgs/gdal
$ cygcheck --sysinfo | grep automake
automake 1.7.9-1
automake-devel 1.8.5-1
automake-stable 1.4p6-2
ricardo@testudo <mailto:ricardo@testudo> ~/pkgs/gdal
$ cygcheck --sysinfo | grep libtool
libtool 1.5b-1
libtool-devel 1.5.6-3
libtool-stable 1.4.3-2
More information about the Cygwin
mailing list