[gdal-dev] GDAL 2.2.0 Compilation error with OSX 10.12
Even Rouault
even.rouault at spatialys.com
Fri May 12 14:15:29 PDT 2017
On vendredi 12 mai 2017 14:01:16 CEST Ruedi Boesch wrote:
> with http://download.osgeo.org/gdal/2.2.0/gdal-2.2.0.tar.gz
> ==>
> ==> no member named 'back' in 'CPLString'
> ==>
> configure ... --enable-pdf-plugin ...
>
> Compiling with macos 10.12 (toolchain XCode 8.3 (Apple LLVM version 8.1.0
> (clang-802.0.42))) fails in
> gdal-2.2.0/frmts/pdf/pdfcreatecopy.cpp:2342
>
> PROBLEM: configure defines HAVE_CXX11, but emits
> libtool: compile: g++ -std=gnu++11 ...
And what if you modify GDALmake.opt (after configure stage) to replace
-std=gnu++11 with -std=c++11 ?
>
> (c++11 supports std:string::back(), but gnu++11 not ??)
>
> ==> WORKAROUND:
> In
> gdal-2.2.0/port/cpl_string.h:383
>
> change
>
> #ifndef HAVE_CXX11
>
> to
>
> // Note: This is standard in C++11.
> #if defined (__APPLE__) || !defined (HAVE_CXX11)
> /** Return last character (undefined behaviour if string is empty) */
> const char& back() const { return operator[](size()-1); }
> /** Return last character (undefined behaviour if string is empty) */
> char& back() { return operator[](size()-1); }
> #endif
>
> Ruedi
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/GDAL-2-2-0-Compilation-error-with-OSX-1
> 0-12-tp5320401.html Sent from the GDAL - Dev mailing list archive at
> Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
--
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170512/516fd214/attachment.html>
More information about the gdal-dev
mailing list