【问题标题】:Can't compile mongodb 2.0 c++ driver无法编译 mongodb 2.0 c++ 驱动程序
【发布时间】:2011-11-19 12:42:58
【问题描述】:

我尝试构建 mongodb c++ 2.0 驱动,但得到以下错误信息:

security_commands.cpp:(.text+0x865): 未定义的引用 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: 在函数中 _GLOBAL__sub_I_security_commands.cpp': security_commands.cpp:(.text.startup+0x1a6): undefined reference to vtable for mongo::CmdLogout' mongo/db/security_common.os: 在函数中 `mongo::AuthenticationInfo::_isAuthorized(std::basic_string, std::allocator > const&, int) const':

【问题讨论】:

  • 您没有链接到正确的库

标签: c++ mongodb compiler-errors driver


【解决方案1】:

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

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

打开 SConstruct 并注释掉这行说

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

你已经准备好了。

【讨论】:

    猜你喜欢
    • 2017-11-07
    • 1970-01-01
    • 2015-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-07
    • 2019-10-05
    相关资源
    最近更新 更多