[gdal-dev] Compile errors when including gdal.lib (trunk version)

Even Rouault even.rouault at mines-paris.org
Mon Oct 14 10:41:22 PDT 2013


Le lundi 14 octobre 2013 18:33:05, Paul Meems a écrit :
> Hi all,
> 
> We're using GDAL in our Open Source GIS application called MapWinGIS (
> https://mapwingis.codeplex.com).
> MapWinGIS is build using Visual Studio 2008 Pro and its language is VC++.
> We've been using GDAL for years now.
> I'm currently in the process of update the external libraries, like GDAL,
> GEOS, etc.
> 
> I have compiled the trunk version of GDAL (v1.10.1), with the trunk version
> of Proj4, GEOS v3.4.2, ERDAS SDK v5 and the latest LizardTech SDK.
> This process seems to be working OK, like it has been for the last several
> years.
> When I test with gdalinfo.exe I can open tiff-files, ECW-files and
> MrSid-files.
> 
> But when I want to include the gdal.lib into MapWinGIS I get two strange
> errors which I don't get if I use GDAL v1.9.
> 
> #1: error LNK2005: _DllMain at 12 already defined in
> mfcs90.lib(dllmodul.obj)    gdal.lib
> #2: fatal error LNK1194: cannot delay-load 'NCSEcw.dll' due to import of
> data symbol '"__declspec(dllimport) const NCS::CMutex::`vftable'"
> (__imp_??_7CMutex at NCS@@6B@)'; link without /DELAYLOAD:NCSEcw.dll
> 
> The second error is about the ERDAS SDK and can be solved by removing
> 'NCSEcw.dll' from the delay load binaries. But I'm not sure if we can still
> show ecw-files.
> 
> #1 seems to be the biggest problem and we've tried several different
> configurations and searched a lot using Google but we can solve this.
> 
> Does anybody understands what is going on and how we can fix this so we can
> use the latest GDAL library?

It seems that you are statically linking to GDAL ? Then try commenting the 
DllMain() implementation in gcore/gdaldllmain.cpp. If this is the root of the 
problem, it probably means that we shouldn't link that file in the static lib. 
Patches welcome !

> 
> 
> Thanks,
> 
> Paul
> 
>  *Paul Meems *
> Release manager, configuration manager
> and forum moderator of MapWindow GIS.
> www.mapwindow.org
> 
> Owner of MapWindow.nl - Support for
> Dutch speaking users.
> www.mapwindow.nl
> 
> *
> *

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list