[Gdal-dev] Exception thrown in GDALOpen() function

Roger James rogerjames99 at btinternet.com
Sun Aug 3 09:12:04 EDT 2003


The other issue with mixed libraries occurs when you are using the dll
version of gdal or are linking the static library version into a dll.
You end up with memory being allocated and freed from different heaps.
This is an issue that both Ben and I have come across, and is why we now
run with modified gdal makefiles that build differently named debug and
non debug versions.

If you are having to resort to using ignoredefaultlibs then it is likely
that you will eventually run into problems.

Roger

> -----Original Message-----
> From: gdal-dev-admin at remotesensing.org [mailto:gdal-dev-
> admin at remotesensing.org] On Behalf Of Ed McNierney
> Sent: 03 August 2003 12:45
> To: gdal-dev at remotesensing.org
> Subject: RE: [Gdal-dev] Exception thrown in GDALOpen() function
> 
> Frank -
> 
> It's not a calling convention problem.  The compiler inserts the name
of
> the appropriate run-time library in the object module when compiling,
so
> the linker will automatically look for it.  If you compile some
objects
> debug and some non-debug, the compiler will have inserted both library
> names into those objects; when you go to link, both runtime libraries
> will be linked and you will get symbol redefinition conflicts.
> 
> This can be worked around by telling the linker to ignore all
libraries
> specified in the object modules and then explicitly listing all the
> libraries you need, but that's pretty tedious and many users don't
> understand how to do it (or how to do it correctly).
> 
> 	- Ed
> 
> Ed McNierney
> President and Chief Mapmaker
> TopoZone.com / Maps a la carte, Inc.
> 73 Princeton Street, Suite 305
> North Chelmsford, MA  01863
> Phone: (978) 251-4242  Fax: (978) 251-1396
> ed at topozone.com
> 
> 
> -----Original Message-----
> From: Frank Warmerdam [mailto:warmerdam at pobox.com]
> Sent: Saturday, August 02, 2003 9:29 PM
> To: gdal-dev at remotesensing.org
> Subject: Re: [Gdal-dev] Exception thrown in GDALOpen() function
> 
> Ben Discoe wrote:
> > Noureddine,
> >
> > It is quite likely that you are using the debug-mode GDAL with your
> > release-mode applications, or vice-versa.  They must match.  This
> means
> > that in order to develop application in both debug and release mode,
> you
> > need to build GDAL both ways.
> 
> Ben,
> 
> Could you clarify why non-debug applications can't use debug versions
of
> the library and the other way around?  It seems to me I often do this
> myself
> without problems.  Is it some difference in calling conventions or
> something
> like that?
> 
> Best regards,
> 
> --
>
---------------------------------------+--------------------------------
> ------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for
Rent
> 
> 
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at remotesensing.org
> http://remotesensing.org/mailman/listinfo/gdal-dev
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at remotesensing.org
> http://remotesensing.org/mailman/listinfo/gdal-dev





More information about the Gdal-dev mailing list