I am trying to compile and build gdal 1.9.2 in Ubuntu 16.04.3. I am doing the below steps

sudo wget http://download.osgeo.org/gdal/gdal192.zip
unzip gdal192.zip -d gdal
cd gdal
cd gdal-1.9.2/
sudo ./configure

When i run make, i am getting the below error

In file included from /usr/include/string.h:630:0,
             from /home/kcube/gdal/gdal-1.9.2/port/cpl_port.h:132,
             from /home/kcube/gdal/gdal-1.9.2/port/cpl_conv.h:34,
             from json_object.c:12:
json_object.c:29:9: error: expected identifier or '(' before '__extension__'
char* strndup(const char* str, size_t n);
GNUmakefile:23: recipe for target '../../o/json_object.lo' failed
make[4]: *** [../../o/json_object.lo] Error 1
make[4]: Leaving directory '/home/kcube/gdal/gdal-1.9.2/ogr/ogrsf_frmts/geojson/jsonc'
../../../GDALmake.opt:539: recipe for target 'jsonc-target' failed
make[3]: *** [jsonc-target] Error 2
make[3]: Leaving directory '/home/kcube/gdal/gdal-1.9.2/ogr/ogrsf_frmts/geojson'
../../GDALmake.opt:539: recipe for target 'geojson-target' failed
make[2]: *** [geojson-target] Error 2
make[2]: Leaving directory '/home/kcube/gdal/gdal-1.9.2/ogr/ogrsf_frmts'
GNUmakefile:51: recipe for target 'sublibs' failed
make[1]: *** [sublibs] Error 2
make[1]: Leaving directory '/home/kcube/gdal/gdal-1.9.2/ogr'
GNUmakefile:56: recipe for target 'ogr-target' failed
make: *** [ogr-target] Error 2

Any idea how to solve this error?

  • 1
    Any reason to compile an outdated GDAL version? The Main Ubuntu repo has v1.11.3, and ubuntugis unstable v2.2.1. – AndreJ Sep 6 '17 at 11:40
  • 1
    why use sudo for the wget and config, normally you only need root to do make install at the end – Ian Turton Sep 6 '17 at 12:06
  • @AndreJ I am trying to install ECW support to geoserver which works only with 1.9.2 – User123 Sep 6 '17 at 13:37
  • @iant I even tried as per your suggestion. But no luck. – User123 Sep 7 '17 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.