How to use libpqxx with qt creator

334 views Asked by At

I use Ubuntu 18.04, Qt creator 4.5.2. I added in pro file:

CONFIG += c++1z
QMAKE_CXXFLAGS += -lpq -lpqxx

Still got following error:

 /usr/local/include/pqxx/strconv.hxx:76: error: undefined reference to `pqxx::internal::demangle_type_name[abi:cxx11](char const*)'
1

There are 1 answers

0
273K On BEST ANSWER

-lpq -lpqxx are linker flags. The variable QMAKE_CXXFLAGS specifies compiler flags. Use the proper variable QMAKE_LIBS for specifying linker flags:

LIBS += -lpq -lpqxx