[Gdal-dev] linking problems with MrSID library

William Kyngesburye woklist at kyngchaos.com
Mon Oct 3 18:56:21 EDT 2005


Um, that may have been a bit confusing.  No, I have not got it to  
work with GCC 4 on Mac OS 10.4 (yes I'm aware of lack of GCC 4  
support for MrSID).  Try this:

     Mac OS 10.3/GCC 3.3 + GDAL 1.2.6 + MrSID = success

I ignored/wasn't aware of changes in GDAL CVS for a long time, then:

     Mac OS 10.4/GCC 4 + GDAL 1.2.6 + MrSID = no go

Then I found GDAL CVS around the time Frank was working on the 1.3.0  
release, and:

     Mac OS 10.4/GCC 4 + GDAL 1.3.0 + MrSID = no go
     Mac OS 10.3/GCC 3.3 + GDAL 1.3.0 + MrSID = no go
     Mac OS 10.4/GCC 4 + GDAL 1.3.1 + MrSID = no go

... it stopped working for GCC 3.3.  This led me to believe it wasn't  
a libstdc++ version problem.  Just going with logic here.

I finally had a chance today to try it on my 10.3 Mac again (it's at  
work):

     Mac OS 10.3/GCC 3.3 + GDAL 1.3.1 + MrSID = success

In GDAL 1.3.0, there were very many of those undefined symbols even  
with GCC 3.3.  Now that appears to be cleared up.  Maybe that was the  
MrSID DSDK 5.x support that was added to GDAL 1.3.1.  So what's left  
may well be the libstdc++ issue.

I had heard that it was possible to build something in GCC 4 linked  
to something built with GCC 3.3 by linking both the new and old  
libstdc++, so I keep attempting this with each new GDAL version to  
try and figure it out.  Since it happens with GCC 3.3 also, I never  
get beyond that to just TRY it.


On Oct 3, 2005, at 4:13 PM, Kirk McKelvey wrote:

> Hello William,
>
> Are you saying you did not get these link errors when using GDAL  
> 1.2.6,
> MrSID 5.0.6.955, and gcc4 on Mac OS 10.4?  Or did one of these other
> variables (SID SDK or compiler) also change?
>
> It seems quite likely to be a stdc++ version issue; gcc 4 is not yet a
> supported compiler with our SDK.  If GDAL *was* the only update and it
> did work before, then while surprising it is still not a complete
> mystery.  What may have happened is that the MrSIDDataset class began
> using more symbols from the MrSID SDK, introducing new dependencies  
> that
> were in turn dependent on libstdc++...
>
> Regarding the addition of xmlparse, this should only be a  
> dependency for
> our Encode SDK.  I think it is added in the wrong place in configure.
> Frank, do you agree with the following patch?
>
> Index: configure.in
> ===================================================================
> RCS file: /cvs/maptools/cvsroot/gdal/configure.in,v
> retrieving revision 1.162
> diff -c -r1.162 configure.in
> *** configure.in    2 Oct 2005 00:59:00 -0000    1.162
> --- configure.in    3 Oct 2005 21:10:05 -0000
> ***************
> *** 1107,1120 ****
>
>       HAVE_MRSID=yes
>       MRSID_INCLUDE="-I$with_mrsid/include/base
> -I$with_mrsid/include/metadata -I$with_mrsid/include/mrsid_readers
> -I$with_mrsid/include/j2k_readers -I$with_mrsid/include/support"
> !     MRSID_LIBS="-lltidsdk -lxmlparse -lpthread"
>
>       AC_MSG_CHECKING([for MG3ImageWriter.h in
> $with_mrsid/include/mrsid_writers])
>       if test -r "$with_mrsid/include/mrsid_writers/ 
> MG3ImageWriter.h" ;
> then
>         AC_MSG_RESULT([found MrSID ESDK version 4.x or newer.])
>         MRSID_FLAGS="-DMRSID_ESDK $MRSID_FLAGS"
>         MRSID_INCLUDE="-I$with_mrsid/include/mrsid_writers
> -I$with_mrsid/include/j2k_writers $MRSID_INCLUDE"
> !       MRSID_LIBS="-lltiesdk -lcryptopp $MRSID_LIBS"
>       fi
>
>       AC_MSG_CHECKING([for MrSID JPEG2000 support])
> --- 1107,1120 ----
>
>       HAVE_MRSID=yes
>       MRSID_INCLUDE="-I$with_mrsid/include/base
> -I$with_mrsid/include/metadata -I$with_mrsid/include/mrsid_readers
> -I$with_mrsid/include/j2k_readers -I$with_mrsid/include/support"
> !     MRSID_LIBS="-lltidsdk -lpthread"
>
>       AC_MSG_CHECKING([for MG3ImageWriter.h in
> $with_mrsid/include/mrsid_writers])
>       if test -r "$with_mrsid/include/mrsid_writers/ 
> MG3ImageWriter.h" ;
> then
>         AC_MSG_RESULT([found MrSID ESDK version 4.x or newer.])
>         MRSID_FLAGS="-DMRSID_ESDK $MRSID_FLAGS"
>         MRSID_INCLUDE="-I$with_mrsid/include/mrsid_writers
> -I$with_mrsid/include/j2k_writers $MRSID_INCLUDE"
> !       MRSID_LIBS="-lltiesdk -lcryptopp -lxmlparse $MRSID_LIBS"
>       fi
>
>       AC_MSG_CHECKING([for MrSID JPEG2000 support])
>
>
> Cheers,
> Kirk
>
> -----Original Message-----
> From: gdal-dev-bounces at lists.maptools.org
> [mailto:gdal-dev-bounces at lists.maptools.org] On Behalf Of William
> Kyngesburye
> Sent: Sunday, October 02, 2005 2:04 PM
> To: gdal-dev at lists.maptools.org
> Subject: [Gdal-dev] linking problems with MrSID library
>
> I've been having problems getting the MrSID dsdk to link to GDAL since
> switching to CVS, and 1.3.x, from 1.2.6 recently.
>
> I'm using the latest MrSID 5.0.6.955.  With the new GDAL 1.3.1a2, I  
> get
> these link errors (compiling completes fine):
>
> ld: Undefined symbols:
> __ZNSt24__default_alloc_templateILb1ELi0EE10deallocateEPvm
> __ZNSt24__default_alloc_templateILb1ELi0EE8allocateEm
> __ZNSs20_S_empty_rep_storageE
> __ZNSaIcE8allocateEmPKv
> __ZNSaIcED4Ev
> __ZNSsD4Ev
> /usr/bin/libtool: internal link edit command failed
>
> With GDAL 1.3.0 and CVS before that, there were a LOT more undefined
> symbols.  I'm using GCC 4 on Mac OS X 10.4, but I've had the same  
> in the
> past using GCC 3.3 on Mac OS X 10.3.8 (haven't had a chance to test
> 1.3.1a2 yet on 10.3), so I don't think it's a libstdc++ version issue,
> yet.
>
> Are those supposed to be in the mrsid library, or some other  
> library?  I
> noticed that libxmlparse (yet another XML library!) was added to the
> mrsid link options - I don't have that and I can't get it to build  
> on OS
> X (it's quite old).  So I removed it from the mrsid link options,  
> since
> I didn't see anything in the GDAL docs or MrSID docs that it needs
> xmlparse.  If GDAL and/or MrSID needs it, it should be mentioned in  
> the
> build requirements.
>
> -----
> William Kyngesburye <kyngchaos at kyngchaos.com> http:// 
> www.kyngchaos.com/
>
> "Those people who most want to rule people are, ipso-facto, those  
> least
> suited to do it."
>
> - A rule of the universe, from the HitchHiker's Guide to the Galaxy
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>

-----
William Kyngesburye <kyngchaos at kyngchaos.com>
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect



More information about the Gdal-dev mailing list