delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/07/13/22:58:39

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: Undefined reference errors and libtool
Date: Tue, 13 Jul 2004 21:58:32 -0500
Message-ID: <E77B3DFC56532248BF83B6AFF923AAE30238F277@bluebird2.home.ku.edu>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
From: "Pereira, Ricardo Scachetti" <rpereira AT ku DOT edu>
To: <cygwin AT cygwin DOT com>
X-OriginalArrivalTime: 14 Jul 2004 02:58:32.0575 (UTC) FILETIME=[72B078F0:01C4694E]
X-IsSubscribed: yes
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id i6E2wavY004207

  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 AT testudo <mailto:ricardo AT 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 AT testudo <mailto:ricardo AT testudo>  ~/pkgs/gdal
$ cygcheck --sysinfo | grep autoconf
autoconf                2.59-1
autoconf-devel          2.59-1
autoconf-stable         2.13-5
ricardo AT testudo <mailto:ricardo AT testudo>  ~/pkgs/gdal
$ cygcheck --sysinfo | grep automake
automake                1.7.9-1
automake-devel          1.8.5-1
automake-stable         1.4p6-2
ricardo AT testudo <mailto:ricardo AT testudo>  ~/pkgs/gdal
$ cygcheck --sysinfo | grep libtool
libtool                 1.5b-1
libtool-devel           1.5.6-3
libtool-stable          1.4.3-2
 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019