g++ - g++ 和 libpqxx lib 出现问题

标签 g++ libpqxx

我有一个非常简单的示例,无法正确构建它,我使用了下一个参数:

g++ -lpq -libpqxx -Wall -o "pg" "pg.cpp" (in dir: /home/user) /usr/lib/gcc/i586-suse-linux/4.5/../../../../i586-suse-linux/bin/ld: cannot find -lpq collect2: ld returned 1 exit status

returned 1 exit status g++ -libpqxx -Wall -o "pg" "pg.cpp" (in dir: /home/user) /usr/lib/gcc/i586-suse-linux/4.5/../../../../i586-suse-linux/bin/ld: cannot find -libpqxx collect2: ld

但每个人都有错误。 libpqxx succ 已安装

@lisuse-home:~> locate libpqxx | grep /lib/ /usr/lib/libpqxx-3.1.so /usr/lib/libpqxx.la /usr/lib/libpqxx.so /usr/lib/pkgconfig/libpqxx.pc

最佳答案

g++ filename.cpp -o target -lpqxx

-lpqxx 应该处理 -lpq。如果由于某种原因找不到 pq,请找到 pq 并将其放在与 pqxx 相同的目录中。

关于g++ - g++ 和 libpqxx lib 出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3854409/

相关文章:

c++ - How to get around GCC ‘*((void*)& b +4)’ may be used uninitialized in this function warning while using boost::optional

opengl - 随处开发 OpenGL 应用程序

c++ - 为什么需要编译用户定义的文件? C++

c++ - 正确的 CMakeLists 文件

postgresql - postgresql 中未执行的删除语句

linux - gcc、icc 或 Microsoft 的 C/C++ 编译器是否支持或了解 NUMA?

C++,与 g++ 相等

c++ - Libpqxx 连接池

c++ - 编译 libpqxx 代码示例时出错?

使用 VC++ 的 Postgresql 连接器