Dean Chen
Dean Chen

Reputation: 3890

Can't compile mongodb 2.0 c++ driver

I tried to build mongodb c++ 2.0 driver,but got the following error message:

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':

Upvotes: 0

Views: 872

Answers (1)

Piti Ongmongkolkul
Piti Ongmongkolkul

Reputation: 2120

The tarball for the driver seems to be missing mongo/db/security.cpp file among others to make a shared lib.

But, it has enough for building static lib with few missing symbol.

open SConstruct and comment out the line saying

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

and you are set.

Upvotes: 1

Related Questions