[gdal-dev] Release of a GDAL 2.0.x and 2.1.x Visual Studio 2010 Solution (static and dynamic lib)

Jan Heckman jan.heckman at gmail.com
Sat Aug 6 13:19:30 PDT 2016


Hi Mateusz,
Thanks for your effort! It is really handy for me.
FYI, a few more things I came across:
- In the dll post build event there are 3 copy commands (dll, lib and exp).
The second and third command need a space before 'copy'.
- Enclosing source and destination file macros in quotes helps.
- in 64 bits compilation (VS2015 community update 1) the link fails with a
C1001 (internal compiler error). This is incurred by gdalexif.cpp, which is
not to blame btw.
  The 'solution' is to turn off compiler optimization for this file only
(and only for x64 compilation). Have not checked whether this happens e.g.
in VS2013.
- diminishing the number of compiler warnings:
 - /D _CRT_SECURE_NO_WARNINGS, if the secure versions are not going to be
used anyway (portability?).
 - change deprecated POSIX (acc. to VS), such as open, read, write, close,
fdopen, setmode to underscored names (_open, _read etc.)
   Not sure whether this is exclusively MS.
- warnings which are somewhat worryable: C4251, when compiling or using
DLL: X used in clas Y needs dll-interface.
  article <https://support.microsoft.com/en-us/kb/168958> claims to solve
this, but not too well, imo, because the proposed solution then causes the
same warning..
  Advice (e.g. gamedev mails
<http://www.gamedev.net/topic/637431-dealing-with-needs-to-have-dll-interface-to-be-used-by-clients-of-class/>)
is
not to export whole classes but only public members and ctor - dtor. More
to be found here
<http://stackoverflow.com/questions/767579/exporting-classes-containing-std-objects-vector-map-etc-from-a-dll?noredirect=1&lq=1>
.
  Claims that some STL (esp vector) can be safely exported, but not all
(map has (or at least had) a static member).
I've never come to grief ignoring C2451, so far.
Jan

On Thu, Aug 4, 2016 at 4:07 PM, Mateusz Loskot <mateusz at loskot.net> wrote:

> On 4 August 2016 at 15:41, Ivan Lucena <lucena_ivan at hotmail.com> wrote:
> > Hi Mateusz,
> >
> > I far as I know the project generated by makegdal_gen.bat does not work
> with newer version of VS.
> >
> > It used to be the case that we can import the project to newer version
> of VS but I think that MS dropped the support for that feature.
> >
> > Have one of you manage to load the generated .vcproj into VS > 2010? I
> would like to know how to do that!
>
> Ivan,
>
> 1. makegdal_gen 10.00 32 > makegdal10.vcproj
> 2. Launch VS2015
> 3. File > Open > Project/Solution...
> 4. Select makegdal10.vcproj
> 5. Accept to upgrade
>
> I can confirm it works for me.
>
> Best regards,
> --
> Mateusz Loskot, http://mateusz.loskot.net
> _______________________________________________
> 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/20160806/949440e4/attachment.html>


More information about the gdal-dev mailing list