[gdal-dev] Starting a discussion on style and coding guidelines

Damian Dixon damian.dixon at gmail.com
Thu May 5 08:48:18 PDT 2016


In the VS World...

If you delete C/C++ memory/objects in a DLL that has been compiled with the
same VS compiler you are ok.

If you attempt to delete a memory/object in DLL/application compiled with a
different version of the VS compiler all bets are off.

For example:

Allocate an object in VS2010 compiled code delete in VS2015 compiled code,
you will likely crash.


You will have to distribute the runtime distribution DLLs for the versions
of VS that you used or your 3rd party DLLs used.

Regards
Damian


On 5 May 2016 at 10:28, Even Rouault <even.rouault at spatialys.com> wrote:

> Le jeudi 05 mai 2016 11:09:48, Mateusz Loskot a écrit :
> > On 5 May 2016 at 01:45, Even Rouault <even.rouault at spatialys.com> wrote:
> > > Of the potential issues with requiring C++11, I can think of OSGeo4W.
> It
> > > is mostly(completely?) built with Visual Studio 2010. And from
> > > https://msdn.microsoft.com/en-us/library/hh567368.aspx , support of
> C++11
> > > is only partial in VS 2010
> >
> > VS2013 is the lowest version sensible to consider regarding C++11
> support.
> >
> > > On the other hand regarding dependencies of GDAL, the binary propritary
> > > SDKs with a C++ API could be a problem, although they will likely move
> > > on too. - FileGDB SDK 1.4: available for VS2010, VS2012, VS2013
> > > - ECW SDK 5.2.1: available for VS2010, VS2012, VS2013
> >
> > AFAICT, GDAL built using VS2015 links against the 5.2.1 version fine.
>
> Do you link against the VS2013 .lib ?
> >
> > > - MrSID SDK: I didn't check. Perhaps Kirk can tell us ?
> >
> > Similarly to the ECW above, version 9.1.0 links fine too.
> >
> > > But I'm not sure about the compatibility of C++11 build against
> non-C++11
> > > builds in the VS realm : can a GDAL C++11 build link against a library
> > > built without C++11 enabled ? Will not there be ABI problems ?
> >
> > Although mixing C run-time libraries is a bad idea generally,
> > kosher C APIs should be fine.
>
> I'm not too worried about C ABI. My mention of C++03 ABI vs C++11 ABI was
> for
> the dependencies with those SDK that we use through their C++ API. In GCC
> world, with same compiler but with different -std=... flags, there have
> been
> troubles ( https://gcc.gnu.org/wiki/Cxx11AbiCompatibility ,
> https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html ), so
> I
> was wondering how the situation is in the VS world.
> Actually since I mention this, the issue does apply to Linux too. Looking
> at
> the C++11 Linux build (
>
> https://github.com/rouault/gdal_coverage/blob/trunk_gcc4.8_stdc11/.travis.yml
> ) , I see I couldn't build against FileGDB with -std=c++11. This was a
> compilation issue with its headers, rather than a link/runtime issue.
>
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160505/19c742c2/attachment.html>


More information about the gdal-dev mailing list