c – Libpqxx抱怨缺少参考文献

所以我有以下问题:

g++ -std=c++0x -O3 -I/usr/include/scip main.cpp locations/locationreader.cpp locations/locationassigner.cpp scheduler.o optimizer.o dbmanager.o scheduleData.o exam.o  -o main -L/usr/lib -lscip  -lreadline  -lgmp -lz -llpispx  -lsoplex  -lobjscip -lnlpi.cppad -lscipopt -lzimpl -lpqxx -lpq  -pthread
/usr/lib/../lib64/libpqxx.so: undefined reference to `PQescapeIdentifier'
collect2: error: ld returned 1 exit status
make: *** [main] Error 1

我无法弄清楚为什么它找不到引用,因为我已经安装了libpq并且它位于/usr/lib64中

$ls | grep pq
libpq.so
libpq.so.5
libpq.so.5.2
libpqxx-4.0.so
libpqxx.so

所以,如果我能得到任何帮助,那将是可爱的

解决方法:

PQescapeIdentifier出现在Postgresql 9.0中,对应于libpq.so.5.3

9.0 release notes有此条目:

Add libpq functions PQescapeLiteral() and PQescapeIdentifier() (Robert
Haas)

您似乎使用Postgresql-8.4(libpq.so.5.2)中的客户端库,这就是它缺少此功能的原因.

相关文章

项目需要,有个数据需要导入,拿到手一开始以为是mysql,结果...
本文小编为大家详细介绍“怎么查看PostgreSQL数据库中所有表...
错误现象问题原因这是在远程连接时pg_hba.conf文件没有配置正...
因本地资源有限,在公共测试环境搭建了PGsql环境,从数据库本...
wamp 环境 这个提示就是说你的版本低于10了。 先打印ph...
psycopg2.OperationalError: SSL SYSCALL error: EOF detect...