RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-697089

Yoel's questions

Martin Hope
Yoel
Asked: 2025-03-10 15:59:00 +0000 UTC

pqxx 构建问题和一堆未定义的引用

  • 4

我正在尝试使用 MinGW 版本 13.2.0 在 Windows 下构建 pqxx。我还使用它编译了 PostgreSQL,因为无法从标准安装的 Postgres 库中编译它。该库本身已编译,IDE 可以看到它,但是在用它构建项目时,它会在 80-84 范围内产生一堆未定义的引用。这个基于 MinGW 中编译的 DBMS 源的库是否会连接到 Windows 上安装的标准 Postgres,我该如何解决这个问题?

我按照BUILDING-cmake 的顺序组装了 pqxx 。

  1. cmake -G "MinGW Makefiles" -DPostgreSQL_ROOT="путь к собранным исходникам Postgres" .
  2. cmake --build .

以下是错误(库路径已更改):

C:/MinGW/bin/mingw32-make.exe -f Makefile.Debug mingw32-make 1:进入目录“D:/Yoel/build-SimpleDatabase-Desktop_Qt_5_14_2_MinGW_64_bit-Debug” g++ -Wl,-subsystem,console -mthreads -o debug\SimpleDatabase.exe debug/main.o -LD:\Yoel\postgresql\lib -lpq -LD:\Yoel\pq\src\libpqxx.a C:\Qt\Qt5.14.2\5.14.2\mingw73_64\lib\libQt5Core.a
C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../x86_64-w64-mingw32/bin/ld.exe: debug/main.o: 在函数throw_for_encoding_error': D:\Yoel\build-SimpleDatabase-Desktop_Qt_5_14_2_MinGW_64_bit-Debug/../pq/include/pqxx/internal/encodings.hxx:124:(.text+0x1c6): undefined reference to pqxx::argument_error::argument_error(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)' C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../x86_64-w64-mingw32/bin/ld.exe: debug/main.o: 在函数__static_initialization_and_destruction_0': D:\Yoel\build-SimpleDatabase-Desktop_Qt_5_14_2_MinGW_64_bit-Debug/../pq/include/pqxx/strconv.hxx:80:(.text+0x40b): undefined reference to pqxx::internal::demangle_type_name[abi:cxx11](char const*)' C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../x86_64-w64-mingw32/bin/ld.exe: D:\Yoel\build-SimpleDatabase-Desktop_Qt_5_14_2_MinGW_64_bit-Debug/../pq/include/pqxx/strconv.hxx:80:(.text+0x43b): 对 pqxx::internal::demangle_type_name[abi:cxx11](char const*)' C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Yoel\build-SimpleDatabase-Desktop_Qt_5_14_2_MinGW_64_bit-Debug/../pq/include/pqxx/strconv.hxx:80:(.text+0x46b): undefined reference to pqxx::internal::demangle_type_name[abi:cxx11](char const*)'未定义引用C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Yoel\build-SimpleDatabase-Desktop_Qt_5_14_2_MinGW_64_bit-Debug/../pq/include/pqxx/strconv.hxx:80:(.text+0x49b): 未定义对 pqxx::internal::demangle_type_name[abi:cxx11](char const*)' C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: debug/main.o: in function pqxx::check_version()' 的引用: D:\Yoel\build-SimpleDatabase-Desktop_Qt_5_14_2_MinGW_64_bit-Debug/../pq/include/pqxx/util.hxx:248:(.text$_ZN4pqxx13check_versionEv[_ZN4pqxx13check_versionEv]+0x31): 对pqxx::internal::check_pqxx_version_7_10()' C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: debug/main.o: in function pqxx::connection::connection(char const*)' 未定义引用: D:\Yoel\build-SimpleDatabase-Desktop_Qt_5_14_2_MinGW_64_bit-Debug/../pq/include/pqxx/connection.hxx:287:(.text$_ZN4pqxx10connectionC1EPKc[_ZN4pqxx10connectionC1EPKc]+0x79): 对 pqxx::connection::~connection() ' 未定义引用pqxx::connection::init(char const*)' C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: debug/main.o: in function : D:\Yoel\build-SimpleDatabase-Desktop_Qt_5_14_2_MinGW_64_bit-Debug/../pq/include/pqxx/connection.hxx:329:(.text$_ZN4pqxx10connectionD1Ev[_ZN4pqxx10connectionD1Ev]+0x14): 未定义对“pqxx::connection::close()”的引用 collect2.exe: 错误:ld 返回 1 退出状态 mingw32-make 1 : *** [Makefile.Debug:68: debug/SimpleDatabase.exe] 错误 1 ​​mingw32-make 1 : 离开目录“D:/Yoel/build-SimpleDatabase-Desktop_Qt_5_14_2_MinGW_64_bit-Debug” mingw32-make: *** [Makefile:45: debug] 错误 2

c++
  • 1 个回答
  • 77 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5