gpt4 book ai didi

c++ - 无法编译 mongodb 2.0 c++ 驱动程序

转载 作者:行者123 更新时间:2023-11-28 08:16:45 24 4
gpt4 key购买 nike

我尝试构建 mongodb c++ 2.0 驱动程序,但收到以下错误消息:

security_commands.cpp:(.text+0x865): undefined reference to mongo::CmdAuthenticate::getUserObj(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, mongo::BSONObj&, std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&)'
security_commands.cpp:(.text+0xa59): undefined reference to
mongo::CmdAuthenticate::authenticate(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, bool)' mongo/db/security_commands.os: In function _GLOBAL__sub_I_security_commands.cpp':
security_commands.cpp:(.text.startup+0x1a6): undefined reference to
vtable for mongo::CmdLogout' mongo/db/security_common.os: In function `mongo::AuthenticationInfo::_isAuthorized(std::basic_string, std::allocator > const&, int) const':

最佳答案

驱动程序的 tarball 似乎缺少 mongo/db/security.cpp 文件等来创建共享库。

但是,它足以构建几乎没有缺失符号的静态库。

打开 SConstruct 并注释掉这行

libs += env.SharedLibrary( "mongoclient" , allClientFiles )

你已经准备好了。

关于c++ - 无法编译 mongodb 2.0 c++ 驱动程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7459249/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com