[gdal-dev] gdal 1.5.3 build error on Linux
Even Rouault
even.rouault at mines-paris.org
Mon Nov 24 16:49:33 EST 2008
Shawn,
In the line where gdalinfo is linked, I see both :
-L/home/marinier/gcc-4.2.2-build/i686-pc-linux-gnu/libstdc++-v3/src/.libs
and
/usr/local/lib/libstdc++.so
That looks like a possible mix of libstdc++ versions...
To make some progress by yourself, I think you should really proceed
step-by-step, that is to say begin by configuring GDAL by disabling all
external drivers (really I mean all. See
http://trac.osgeo.org/gdal/wiki/BuildingOnUnixWithMinimizedDrivers), make
clean and make
And then, add a new external library, one at a time, until you find the
culprit.
You currently link, explicitely and implicitely, to many external libraries,
some in /usr/lib (should be no problem theoretically), some
in /usr/local/lib, some in your home, some in apparently other homes.... :
- curl
- expat
- libz
- libsz
- ogdi
- hdf4
- hdf5
- jpeg
Good luck!
Best regards
Le Monday 24 November 2008 22:12:40, vous avez écrit :
> Thanks Frank.
>
> I have tried to build on gdal 1.5.3 (w/o HDF) and overnight stable
> branch. I got the same error message. But libgdal.so.1.12.3 was created
> in gdal-1.5.3/.libs/
>
> What is the problem?
>
> ========================================
> /bin/sh /home/sgong/dev181/gdal-1.5.3/libtool --mode=compile --tag=CC
> gcc -g -O2 -Wall -Wdeclaration-after-statement
> -I/home/sgong/dev181/gdal-1.5.3/port
> -I/home/sgong/dev181/gdal-1.5.3/gcore
> -I/home/sgong/dev181/gdal-1.5.3/alg -I/home/sgong/dev181/gdal-1.5.3/ogr
> -I/home/sgong/dev181/gdal-1.5.3/ogr/ogrsf_frmts
> -I/home/sgong/dev181/gdal-1.5.3/frmts -DOGR_ENABLED
> -I/home/sgong/dev181/gdal-1.5.3/port -I/home/sgong/dev181/dist
> -I/home/sgong/dev181/dist/include -c -o gdalinfo.o gdalinfo.c
> libtool: compile: gcc -g -O2 -Wall -Wdeclaration-after-statement
> -I/home/sgong/dev181/gdal-1.5.3/port
> -I/home/sgong/dev181/gdal-1.5.3/gcore
> -I/home/sgong/dev181/gdal-1.5.3/alg -I/home/sgong/dev181/gdal-1.5.3/ogr
> -I/home/sgong/dev181/gdal-1.5.3/ogr/ogrsf_frmts
> -I/home/sgong/dev181/gdal-1.5.3/frmts -DOGR_ENABLED
> -I/home/sgong/dev181/gdal-1.5.3/port -I/home/sgong/dev181/dist
> -I/home/sgong/dev181/dist/include -c gdalinfo.c -fPIC -DPIC -o
> .libs/gdalinfo.o
> libtool: compile: gcc -g -O2 -Wall -Wdeclaration-after-statement
> -I/home/sgong/dev181/gdal-1.5.3/port
> -I/home/sgong/dev181/gdal-1.5.3/gcore
> -I/home/sgong/dev181/gdal-1.5.3/alg -I/home/sgong/dev181/gdal-1.5.3/ogr
> -I/home/sgong/dev181/gdal-1.5.3/ogr/ogrsf_frmts
> -I/home/sgong/dev181/gdal-1.5.3/frmts -DOGR_ENABLED
> -I/home/sgong/dev181/gdal-1.5.3/port -I/home/sgong/dev181/dist
> -I/home/sgong/dev181/dist/include -c gdalinfo.c -o gdalinfo.o >/dev/null
> 2>&1
> /bin/sh /home/sgong/dev181/gdal-1.5.3/libtool --mode=link g++
> gdalinfo.o \
> /home/sgong/dev181/gdal-1.5.3/libgdal.la -o gdalinfo
> libtool: link: g++ gdalinfo.o -o .libs/gdalinfo
> /home/sgong/dev181/gdal-1.5.3/.libs/libgdal.so -L/usr/local/lib
> -L/home/sgong/dev181/dist/lib -L/home/sgong/dev181/dist -L/usr/lib
> -L/usr/kerberos/lib
> -L/home/marinier/gcc-4.2.2-build/i686-pc-linux-gnu/libstdc++-v3/src
> -L/home/marinier/gcc-4.2.2-build/i686-pc-linux-gnu/libstdc++-v3/src/.lib
> s -L/home/marinier/gcc-4.2.2-build/./gcc /usr/local/lib/libexpat.so
> /home/sgong/dev181/dist/lib/libhdf5.so
> /home/sgong/dev181/dist/lib/libsz.so -lmfhdf -ldf
> /usr/local/lib/libsz.so -logdi31 /usr/lib/libjpeg.so -lpq -lrt
> /usr/local/lib/libcurl.so -lldap -lssl -lcrypto -lgssapi_krb5 -lkrb5
> -lcom_err -lk5crypto -lresolv -ldl -lz /usr/local/lib/libstdc++.so -lm
> -lc -lgcc_s -Wl,-rpath -Wl,/home/sgong/dev181/dist/lib -Wl,-rpath
> -Wl,/usr/local/lib/usr/bin/ld: warning: libcom_err.so.3, needed by
> /usr/lib/libssl.so, may conflict with libcom_err.so.2
> /home/sgong/dev181/gdal-1.5.3/.libs/libgdal.so: undefined reference to
> `std::__default_alloc_template<true, 0>::allocate(unsigned int)'
> /home/sgong/dev181/gdal-1.5.3/.libs/libgdal.so: undefined reference to
> `std::__default_alloc_template<true, 0>::_S_free_list'
> /home/sgong/dev181/gdal-1.5.3/.libs/libgdal.so: undefined reference to
> `std::__default_alloc_template<true, 0>::_Lock::~_Lock()'
> /home/sgong/dev181/gdal-1.5.3/.libs/libgdal.so: undefined reference to
> `std::__default_alloc_template<true, 0>::_S_force_new'
> /home/sgong/dev181/gdal-1.5.3/.libs/libgdal.so: undefined reference to
> `std::__default_alloc_template<true, 0>::_Lock::_Lock()'
> /home/sgong/dev181/gdal-1.5.3/.libs/libgdal.so: undefined reference to
> `std::basic_string<char, std::char_traits<char>, std::allocator<char>
>
> >::_Rep::_S_create(unsigned int, std::allocator<char> const&)'
>
> /home/sgong/dev181/gdal-1.5.3/.libs/libgdal.so: undefined reference to
> `std::__default_alloc_template<true, 0>::_S_refill(unsigned int)'
> /home/sgong/dev181/gdal-1.5.3/.libs/libgdal.so: undefined reference to
> `std::basic_string<char, std::char_traits<char>, std::allocator<char>
>
> >::_S_empty_rep_storage'
>
> /home/sgong/dev181/gdal-1.5.3/.libs/libgdal.so: undefined reference to
> `std::__default_alloc_template<true, 0>::_S_node_allocator_lock'
> /home/sgong/dev181/gdal-1.5.3/.libs/libgdal.so: undefined reference to
> `std::__default_alloc_template<true, 0>::deallocate(void*, unsigned
> int)'
> collect2: ld returned 1 exit status
> make[1]: *** [gdalinfo] Error 1
> make[1]: Leaving directory `/home/sgong/dev181/gdal-1.5.3/apps'
> make: *** [apps-target] Error 2
>
>
> thanks,
> Shawn
>
>
> -----Original Message-----
> From: gdal-dev-bounces at lists.osgeo.org
> [mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Frank Warmerdam
> Sent: Monday, November 24, 2008 11:05 AM
> To: Gong, Shawn (Contractor)
> Cc: gdal-dev at lists.osgeo.org
> Subject: Re: [gdal-dev] gdal 1.5.3 dependencies on Linux
>
> Gong, Shawn (Contractor) wrote:
> > hi list,
> >
> > I am building gdal 1.5.3 on Linux (RHEL).
> >
> > I build the dependencies as follows (this was what I used for gdal
>
> 1.4.0):
> > 1) glib 1.2.10
> >
> > 2) gtk+ 1.2.10 # stay with gtk 1.3 now, I plan to upgrade to
> >
> > gtk 2 in near future
> >
> > 3) Mesa 5.0.2 (Mesalib only, no demo, no glut)
> >
> > 4) gtkglarea-1.2.2
> >
> > 5) python 2.5.2
> >
> > 6) pygtk-0.6.12
> >
> > 7) gtk+extra-0.99.17
> >
> > 8) python-gtkextra-0.22 # 6), 7) 8) are for gtk 1.3
>
> Shawn,
>
> The above are irrelevant for GDAL - they are OpenEV dependencies.
>
> > 10) proj-4.4.7
> >
> > 11) gdal external format libraries
> >
> > 11a) zlib-1.2.3
> >
> > 11b) jpeg-6b
> >
> > 11c) szip-2.1
> >
> > 11d) HDF5
> >
> > 11e) HDF4
> >
> > 12) gdal-1.5.3 (w/ rsat2 driver from 1.6 beta)
>
> The above should generally be fine, though you weren't specific
> about versions. You might want to keep an eye on the
> http://trac.osgeo.org/gdal/wiki/BuildHints for some details on
> HDF4 and HDF5.
>
> > Would someone confirm that the above dependencies are right?
> >
> > another question about gcc, I have been using
> > /usr/lib/libstdc++.so.5.0.3, is it too old for gdal-1.5.3?
>
> I am not aware of any specific dependencies on a libstdc++ version
> in GDAL. Generally the important thing is just to use the regular
> versions that is associated with the g++ you are building with and
> to avoid mixing or overriding.
>
> Best regards,
More information about the gdal-dev
mailing list