[gdal-dev] GDAL 2.2.0 Compilation error with OSX 10.12

Even Rouault even.rouault at spatialys.com
Sat May 13 02:36:18 PDT 2017


On samedi 13 mai 2017 10:58:01 CEST Ruedi Boesch wrote:
> with GDALmake.opt:
> ...
> CC	=	$(LIBTOOL_COMPILE_CC) gcc
> CXX	=	$(LIBTOOL_COMPILE_CXX) g++ -std=c++11
> LD	=	$(LIBTOOL_LINK)	g++ -std=gnu++11
> ...
> 
> I get:
> 
> libtool: compile:  g++ -std=c++11 -DHAVE_AVX_AT_COMPILE_TIME
> -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2 -Wall ....
> 
> pdfcreatecopy.cpp:2342:37: error: no member named 'back' in 'CPLString'
>                         osLabelText.back() == '}' )
>                         ~~~~~~~~~~~ ^
> 1 error generated.

OK. No better. I guess then that you should try the solution exposed in
https://lists.osgeo.org/pipermail/gdal-dev/2017-April/046531.html



> 
> Ruedi
> 
> > Am 12.05.2017 um 23:15 schrieb Even Rouault <even.rouault at spatialys.com>:
> > 
> > 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
> > > <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-OS
> > > X-1
> > > <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 <http://nabble.com/>.
> > > _______________________________________________
> > > gdal-dev mailing list
> > > gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org>
> > > https://lists.osgeo.org/mailman/listinfo/gdal-dev
> > > <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/20170513/11de0e97/attachment-0001.html>


More information about the gdal-dev mailing list