Skip to content
Advertisement

No path in “pkg-config proj –libs” – Known problem of “proj_api.h not found in standard or given locations”

No clue why this: pkg-config proj --libs

gives: -lproj

when it should be: -L/usr/lib/x86_64-linux-gnu -lproj

because proj.pc is in /usr/lib/x86_64-linux-gnu/pkgconfig/

Now, is this problem related to proj_api.h not found in standard or given locations? My LMint 20.1 does not find that. I keep getting:

PROJ header location specified: -I/usr/include - check if proj_api.h is there...
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
configure: error: Did not find PROJ headers according to --with-proj-include - check the installation!

Even though proj_api.h is here:

$ locate proj_api.h
/usr/include/proj_api.h

Is this a problem with PROJ4 version 7.2.1-1? I found some posts about this (eg. this one about PKG_CONFIG_PATH in .bashrc) but no solutions. Any help is much appreciated,

— PROJ4 version:

ii  libproj-dev:amd64                          7.2.1-1~focal0                        amd64        Cartographic projection library (development files)
ii  libproj19:amd64                            7.2.1-1~focal0                        amd64        Cartographic projection library
ii  proj-bin                                   7.2.1-1~focal0                        amd64        Cartographic projection library (tools)
ii  proj-data                                  7.2.1-1~focal0                        all          Cartographic projection filter and library (datum package)

Advertisement

Answer

Found it, the solution is to put ACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1 before the configure call like this:

sudo CFLAGS="-I/usr/include -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1" ./configure --prefix=/home/gery/misProgramas/mb/mbsystem-trunk.r2346 --with-gmt-config=/home/gery/misProgramas/gmt/gmt-5.4.4/bin --with-otps-dir=/home/gery/misProgramas/mb/OTPS2

These links may be useful: https://github.com/postgis/postgis/pull/354/files# and https://github.com/OSGeo/PROJ/issues/836

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement