Problem compiling program with pqxx

天涯浪子 提交于 2019-12-04 10:08:03

After an email exchange with pqxx author Jeroen T. Vermeulen, I could manage to compile the 'program'. The idea was to place xx.cpp before -lpqxx -lpq So, the entire command is:

g++ -I /usr/local/include/pqxx/ -L /usr/local/lib/ -I /usr/local/pgsql/include/ -L /usr/local/pgsql/lib/ xx.cpp -lpqxx  -lpq

It works now.

Works for me here with a simple g++ -lpqxx xx.cpp, so it terribly looks like a broken installation. Note that you don't need to link with libpq, as libpqxx with take care of that for you if you are using shared objects.

Check that you don't have the libpqxx library installed in different places, like /usr/lib, /usr/local, and /usr/local/pgsql/lib.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!