fatal error: postgresql/libpq-fe.h: No such file or directory
CapSel opened this issue · 3 comments
I've just updated sqlpp11 and your project and I can't compile it.
$ cmake ..
-- The CXX compiler identification is GNU 5.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using /usr/bin/c++ (compiler id: GNU)
-- Found Sqlpp11: /usr/local/include/sqlpp11
-- Configuring done
-- Generating done
-- Build files have been written to: /home/capsel/libs/sqlpp11-connector-postgresql/build
[capsel@ai build]$ make
Scanning dependencies of target sqlpp-postgresql
[ 20%] Building CXX object src/CMakeFiles/sqlpp-postgresql.dir/bind_result.cpp.o
In file included from /home/capsel/libs/sqlpp11-connector-postgresql/src/bind_result.cpp:34:0:
/home/capsel/libs/sqlpp11-connector-postgresql/src/detail/prepared_statement_handle.h:35:33: fatal error: postgresql/libpq-fe.h: No such file or directory
compilation terminated.
src/CMakeFiles/sqlpp-postgresql.dir/build.make:62: recipe for target 'src/CMakeFiles/sqlpp-postgresql.dir/bind_result.cpp.o' failed
make[2]: *** [src/CMakeFiles/sqlpp-postgresql.dir/bind_result.cpp.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'src/CMakeFiles/sqlpp-postgresql.dir/all' failed
make[1]: *** [src/CMakeFiles/sqlpp-postgresql.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
postgresql version is 9.5.2.
My distribution holds postgres headers in postgresql directory (not in pgsql like you have, probably) you need to change the path to pgsql/libpq-fe.h (or something similar I don't remember to exact directory name)
Could you try applying attached patch file to newest commit from branch master and compiling?
This is fixed in the last commit on the master branch.
Regards, Matthijs