[gdal-dev] Is 2.1.4 supposed to require C++11 ?

Andrew C Aitchison andrew at aitchison.me.uk
Sun Jul 2 13:07:57 PDT 2017


On Fri, 30 Jun 2017, Even Rouault wrote:

> On behalf of the GDAL/OGR development team, I am pleased to announce the release of the
> GDAL/OGR 2.2.1 and 2.1.4 bug fix versions.

Sorry I didn't catch this before you made the release.

I have no problem with 2.2.1, but 2.1.4 (and the RC) fails to build
for me on Scientific Linux 6.9 (should be same as RHEL6 or Centos 6)
jasper version 1.900.1-21.el6_9
and g++ version g++ (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)



libtool: compile:  g++ -c -I/home/werdna/gdal2.1.4/gdal-2.1.4/port
 	-I/home/werdna/gdal2.1.4/gdal-2.1.4/gcore
     -I/home/werdna/gdal2.1.4/gdal-2.1.4/alg
     -I/home/werdna/gdal2.1.4/gdal-2.1.4/ogr
     -I/home/werdna/gdal2.1.4/gdal-2.1.4/ogr/ogrsf_frmts
     -I/home/werdna/gdal2.1.4/gdal-2.1.4/gnm
     -I/home/werdna/gdal2.1.4/gdal-2.1.4/apps -DOGR_ENABLED
     -I/home/werdna/gdal2.1.4/gdal-2.1.4/port -I/usr/include
     -I/usr/include/cfitsio -DGDAL_COMPILATION -Idegrib18/degrib -DHAVE_JASPER
     -g -O2 -Wall -Wextra -Winit-self -Wunused-parameter -Wformat
     -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow
     -Werror=vla -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual
     -fno-operator-names degrib18/g2clib-1.0.4/dec_jpeg2000.cpp  -fPIC -DPIC -o
     ../o/.libs/dec_jpeg2000.o
In file included from /usr/include/jasper/jasper.h:77:0,
                  from degrib18/g2clib-1.0.4/dec_jpeg2000.cpp:18:
/usr/include/jasper/jas_math.h: In function 'bool 
jas_safe_size_mul(size_t, size_t, size_t*)':
/usr/include/jasper/jas_math.h:143:15: error: 'SIZE_MAX' was not declared 
in this scope
   if (x && y > SIZE_MAX / x) {
                ^
/usr/include/jasper/jas_math.h: In function 'bool 
jas_safe_size_add(size_t, size_t, size_t*)':
/usr/include/jasper/jas_math.h:170:10: error: 'SIZE_MAX' was not declared 
in this scope
   if (y > SIZE_MAX - x) {
           ^
make[2]: *** [../o/dec_jpeg2000.lo] Error 1
make[2]: Leaving directory `/home/werdna/gdal2.1.4/gdal-2.1.4/frmts/grib'
make[1]: *** [grib-install-obj] Error 2
make[1]: Leaving directory `/home/werdna/gdal2.1.4/gdal-2.1.4/frmts'
make: *** [frmts-target] Error 2

-------------------------
There are similar problems with jpeg2000/jpeg2000dataset.cpp and
jpeg2000_vsil_io.cpp (which also include jasper.h).

However, if I add -std=gnu++11 or -std=c++11 to the compile line for
these files, then they compile without warning or error.  The
whole gdal build and install then completes.

-std=gnu++03 and -std=c++03 do not resolve the error, so I wonder
whether we have accidentally added a dependancy for C++13 in 2.1.4 ?

Thanks,

-- 
Andrew C Aitchison			Cambridge, UK


More information about the gdal-dev mailing list