[Gdal-dev] MrSID Cross-Compiler Information
Bill Binko
bill at binko.net
Mon Aug 22 17:14:14 EDT 2005
Hi everyone,
I have some good news on this front. After discussing this with Frank, I
went digging and found a way to link GDAL with a version of the MrSID SDK
that was built with a different version of GCC.
This page gives the (very) gory details: http://gcc.gnu.org/onlinedocs/libstdc++/abi.html
Bug basically, if you're having linking troubles that look like this:
../.libs/libgdal.so: undefined reference to `std::__default_alloc_template<true, 0>::allocate(unsigned int)'
../.libs/libgdal.so: undefined reference to `std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned int, std::allocator<wchar_t> const&)'
You probably are running against a library linked with an older GCC C++
library.
In the past the only solution known (at least to Frank and I) was to build
a version of GDAL using the same GCC version. After reading the above
link, I found that you can instead just manually force the linker to link
to both stdc++ libraries (assuming you have both on your system)
So: to accomplish this, simply make the following change in GDALmake.opt:
CONFIG_LIBS = $(LIBGDAL)
becomes
CONFIG_LIBS = $(LIBGDAL) /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.6
A clean rebuild should solve your link errors. I am interested to see how
people do with this, so please contact me with any issues.
Bill
More information about the Gdal-dev
mailing list