Opened 6 years ago

Closed 6 years ago

#7148 closed defect (invalid)

postgisraster.h:41:22: fatal error: libpq-fe.h: No such file or directory

Reported by: ryszard Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: 2.2.2
Severity: normal Keywords:
Cc:

Description

I am not quite sure if this is a bug or not, but libpq-fe.h cannot be found during compilation even though directory containing this file is specified for ./configure; see below Your help is appreciated.

$ pwd
/home/ryszard/Downloads/gdal-2.2.2
$ ls -l /usr/local/pgsql/include/libpq-fe.h
-rw-r--r-- 1 root root 22179 Nov 14 13:47 /usr/local/pgsql/include/libpq-fe.h
$ ./configure --includedir=/usr/local/pgsql/include >& /tmp/conf.log
$ make >& /tmp/make.log
$ tail -13 /tmp/make.log
In file included from postgisrasterdriver.cpp:31:0:
postgisraster.h:41:22: fatal error: libpq-fe.h: No such file or directory
 #include "libpq-fe.h"
                      ^
compilation terminated.
../../GDALmake.opt:646: recipe for target '../o/postgisrasterdriver.lo' failed
make[2]: *** [../o/postgisrasterdriver.lo] Error 1
make[2]: Leaving directory '/home/ryszard/Downloads/gdal-2.2.2/frmts/postgisraster'
GNUmakefile:15: recipe for target 'postgisraster-install-obj' failed
make[1]: *** [postgisraster-install-obj] Error 2
make[1]: Leaving directory '/home/ryszard/Downloads/gdal-2.2.2/frmts'
GNUmakefile:87: recipe for target 'frmts-target' failed
make: *** [frmts-target] Error 2
$ uname -a
Linux ubuntu 4.10.0-37-generic #41~16.04.1-Ubuntu SMP Fri Oct 6 22:42:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$

Attachments (1)

make.log.gz (48.6 KB ) - added by ryszard 6 years ago.
gzipped output from "make >& /tmp/make.log" command

Download all attachments as: .zip

Change History (4)

comment:1 by Even Rouault, 6 years ago

I've no idea if --includedir is honoured, but you should rather try --with-pg=/usr/local/pgsql/bin/pg_config

by ryszard, 6 years ago

Attachment: make.log.gz added

gzipped output from "make >& /tmp/make.log" command

comment:2 by ryszard, 6 years ago

./configure --with-pg=/usr/local/pgsql/bin/pg_config

solves the original problem (i.e. postgisraster.h:41:22: fatal error: libpq-fe.h: No such file or directory), but make fails with large number of undefined references (full log from make attached)

$ tail /tmp/make.log
/usr/lib/x86_64-linux-gnu/libpq.so: undefined reference to `SHA224_Update@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libgeos_c.so: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/usr/lib/x86_64-linux-gnu/libpq.so: undefined reference to `SSL_get_peer_certificate@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libgeos-3.5.0.so: undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const@GLIBCXX_3.4.21'
collect2: error: ld returned 1 exit status
GNUmakefile:82: recipe for target 'gdalinfo' failed
make[1]: *** [gdalinfo] Error 1
make[1]: Leaving directory '/home/ryszard/Downloads/gdal-2.2.2/apps'
GNUmakefile:93: recipe for target 'apps-target' failed
make: *** [apps-target] Error 2
$

comment:3 by Even Rouault, 6 years ago

Resolution: invalid
Status: newclosed

There might be something particular to your setup that is likely not a defect of GDAL. So closing that picket.

The C++ linking errors might perhaps come from C++11 ABI vs non-C++11 ABI mixing (pre vs post GCC 5.1). And fr the SSL stuff, perhaps libpq.so doesn't link against the openssl lib it was built against.

Note: See TracTickets for help on using tickets.