[gdal-dev] Cannot Build GDAL 3.1.0 on Ubuntu 18.04

Ben Van Riper bengvr at gmail.com
Tue May 26 14:02:12 PDT 2020


I undid the changes that I made to the makefiles and am now getting the
following error:
>
> make[2]: Entering directory
> '/home/ben/software/gdal/gdal-3.1.0/frmts/grass'
> /bin/bash /home/ben/software/gdal/gdal-3.1.0/libtool --mode=compile
> --silent --tag=CXX g++ -I/home/ben/software/gdal/gdal-3.1.0/port
> -I/home/ben/software/gdal/gdal-3.1.0/gcore
> -I/home/ben/software/gdal/gdal-3.1.0/alg
> -I/home/ben/software/gdal/gdal-3.1.0/ogr
> -I/home/ben/software/gdal/gdal-3.1.0/ogr/ogrsf_frmts
> -I/home/ben/software/gdal/gdal-3.1.0/gnm
> -I/home/ben/software/gdal/gdal-3.1.0/apps -DHAVE_AVX_AT_COMPILE_TIME
> -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall
> -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security
> -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdate-time
> -Wnull-dereference -Wduplicated-cond -Wfloat-conversion
> -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual
> -fno-operator-names -Wzero-as-null-pointer-constant -Wsuggest-override
> -Wimplicit-fallthrough  -DGRASS_GISBASE=\"/usr/lib/grass74\"
> -I/usr/lib/grass74/include -I/usr/local/include -DGNM_ENABLED -D_REENTRANT
>  -I/home/ben/software/gdal/gdal-3.1.0/port -I/usr/include/openjpeg-2.3
> -I/usr/include -I/usr/local/share/libgta -I/usr/local/share/libgta/include
> -I/usr -I/usr/include  -DGDAL_COMPILATION -DHAVE_XERCES -I/usr/include
> -I/usr/include/xercesc -D_REENTRANT
>  -I/home/ben/software/gdal/gdal-3.1.0/port -I/usr/include/openjpeg-2.3
> -I/usr/include -I/usr/local/share/libgta -I/usr/local/share/libgta/include
> -I/usr -I/usr/include  -DGDAL_COMPILATION -c -o ../o/grass57dataset.lo
> grass57dataset.cpp
> In file included from /usr/lib/grass74/include/grass/gprojects.h:21:0,
>                  from grass57dataset.cpp:50:
> /usr/local/include/proj_api.h:37:2: error: #error 'To use the proj_api.h
> you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
>  #error 'To use the proj_api.h you must define the macro
> ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
>   ^~~~~
> ../../GDALmake.opt:649: recipe for target '../o/grass57dataset.lo' failed
> make[2]: *** [../o/grass57dataset.lo] Error 1
> make[2]: Leaving directory '/home/ben/software/gdal/gdal-3.1.0/frmts/grass'
> GNUmakefile:15: recipe for target 'grass-install-obj' failed
> make[1]: *** [grass-install-obj] Error 2
> make[1]: Leaving directory '/home/ben/software/gdal/gdal-3.1.0/frmts'
> GNUmakefile:105: recipe for target 'frmts-target' failed
> make: *** [frmts-target] Error 2
>
When you say that my environment might be linking against the proj.h from
PROJ5, I think that's possible, and if I'm not mistaken, I did have PROJ5
installed (or was it 4?) when I compiled GDAL v2.4.0. I suppose I can
uninstall the old version and try again, but does that explain the current
error I'm having?

On Tue, May 26, 2020 at 4:32 PM Even Rouault <even.rouault at spatialys.com>
wrote:

> > I'm compiling against PROJ6, if that explains any of these issues. I know
>
> > that I had to go into one of the makefiles in the source tree and add a
>
> > compiler flag to allow use of the deprecated API, (don't remember the
> flag
>
> > name), so maybe this is related to that?
>
>
>
> Quite certainly. Don't do this. It is likely that in your include path you
> have the proj.h file of PROJ 5, and proj_experimental.h includes that one
> instead of the proj.h that matches it. Some cleanup in your build
> environment seems necessary
>
>
>
> Even
>
>
>
> --
>
> Spatialys - Geospatial professional services
>
> http://www.spatialys.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200526/a487058d/attachment.html>


More information about the gdal-dev mailing list