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

Mateusz Loskot mateusz at loskot.net
Thu Mar 2 01:43:44 PST 2017


On 2 March 2017 at 10:32, Idan Miara <idan at miara.com> 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?

If you stick to GDAL C API and if you know what you are doing
and if you are careful, you should be fine.
GDAL DLL is fairly well isolated, especially in terms of allocations
and deallocations
which all happen inside GDAL DLL and do not cross the DLL/DLL or
DLL/EXE boundaries.
Read about "How should I deallocate resources acquainted from GDAL on
Windows?" here
https://trac.osgeo.org/gdal/wiki/FAQMiscellaneous

> Is there a good reason for osgeo4w for keep choosing MSVC2010 for GDAL?

Possibly, it's due to maintenance vs man power resources.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net


More information about the gdal-dev mailing list