[gdal-dev] Linking against gdal201.dll with different MSVC versions

Even Rouault even.rouault at spatialys.com
Thu Mar 2 01:43:16 PST 2017


On jeudi 2 mars 2017 11:32:11 CET Idan Miara wrote:
> Hi,
> 
> I'm developing a c++ MSVC (2013 or 2015) program that depends on GDAL.
> Currently I'm using the C API, and I might use the C++ API in the future.
> 
> I've run dependency walker on the recent version of gdal201.dll that is
> distributed in osgeo4w, it depends on msvcr100.dll, thus I assume it was
> compiled with MSVC2010.
> 
> I was wondering if I could encounter problems with my program for linking
> against osgeo4w MSVC2010 gdal201 binaries while my program is compiled with
> MSVC 2013 or 2015.
> For that matter, does it make a difference if I use GDAL C API or the C++
> API?

Yes. You're probably safe if using different MSVC versions for your code and the GDAL build, 
if you use the C API (that's what QGIS does for example). If you use the C++ API, you'll need 
to use the same compiler and compiler settings.

> 
> I see that GDAL can be compiled with MSVC2013 (gisinternals.com), and that
> QGIS master is built with MSVC2015.
> Is there a good reason for osgeo4w for keep choosing MSVC2010 for GDAL?

Probably because the last GDAL built in OSGeo4W was done with MSVC2010, before the 
recent upgrade to MSVC2015 for QGIS master. I guess the next GDAL builds will be done with 
MSVC2015 too.

Even


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170302/bed1ad10/attachment.html>


More information about the gdal-dev mailing list