1

我在尝试将应用程序与 mongodb C++ 驱动程序链接时遇到一个链接器错误。我不确定出了什么问题。

(.rodata._ZTVN5mongo16ConnectExceptionE[_ZTVN5mongo16ConnectExceptionE]+0x40): undefined reference to `mongo::DBException::toString() const'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
4

1 回答 1

0

为什么要使用如此过时的 C++ 驱动程序版本?使用最新版本的旧版 C++ 驱动程序,您将获得更好的运气:

https://github.com/mongodb/mongo-cxx-driver/releases/tag/legacy-1.1.0

更好的是,使用新的 C++11 驱动程序:

https://github.com/mongodb/mongo-cxx-driver/releases/tag/r3.0.0

于 2016-02-20T17:33:08.960 回答