我尝试构建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&gt; const&amp;, std :: basic_string,std :: allocator&gt; const&amp;,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&gt; const&amp;,int)const':
答案 0 :(得分:1)
驱动程序的tarball似乎缺少mongo / db / security.cpp文件以创建共享库。
但是,它足以构建具有少量缺失符号的静态库。
打开SConstruct并注释掉
行libs + = env.SharedLibrary(“mongoclient”,allClientFiles)
你就定了。