一个例子:
https://github.com/Pr0Wolf29/libpqxx-example/blob/master/pqxx_example.cpp
安装pqxx:
wget http://pqxx.org/download/software/libpqxx/libpqxx-4.0.tar.gz tar xvfz libpqxx-4.0.tar.gz cd libpqxx-4.0 ./configure make make install
安装后在qt中使用在pro中要加上,不然会编译错误:
LIBS += -L/usr/local/lib/ -lpqxx