[Thuban-list] Implementation of GDAL
Bernhard Herzog
bh at intevation.de
Tue Sep 30 15:29:36 CEST 2003
Stephan Holl <sholl at gmx.net> writes:
> ~/cvs/thuban/Lib > python -c "import gdalwarp"
> Traceback (most recent call last):
> File "<string>", line 1, in ?
> ImportError: ./gdalwarp.so: undefined symbol: __gxx_personality_v0
This looks like some library was missing when linking gdalwarp.so.
According to google this is probably because gdalwarp.cpp is compiled as
c++ but linked by gcc which doesn't automatically include libstdc++. We
don't have problem because we still mostly use gcc 2.95.
This seems to be a bug in distutils in Python < 2.3. There doesn't seem
to be an easy fix, unfortunately, but there are several options:
- Use the distutils from Python 2.3 which automatically use the c++
compiler for linking extensions written in C++
I just tried this by creating a symbolic link to the directory
containing distutils in the thuban source directory and then running
the setup.py script normally (after removing the build subdirectory
to make sure everything is rebuilt properly)
ln -s path/to/python/lib/python2.3/distutils/ .
rm -r build/
python2.2 setup.py build
This works for me but all I can easily check is it does indeed call
the c++ compiler. I don't have a system with gcc 3.0 where all the
other stuff Thuban requires is already available. The distutils of
Python 2.3 work fine with Python 2.2 apparently.
- Do the link step of gdalwarp manually by copying the commandline
printed by setup.py and replacing the gcc with g++
- Add "stdc++" to the libraries list in the Extension call for
Lib.gdalwarp in setup.py (line 1089 or thereabouts)
Bernhard
--
Intevation GmbH http://intevation.de/
Sketch http://sketch.sourceforge.net/
Thuban http://thuban.intevation.org/
More information about the Thuban-list
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)