Compiling C++ with MongoDB -


i getting bunch of error when try compile c++ code connect mongodb.

using command: directories refer mongoclient lib , boost libs.

g++ tutorial.cpp -o tutorial -i/usr/include/mongo/client -l/usr/lib -l/usr/lib/i386-linux-gnu/

any suggesttion how fix error

labuser@labuser:~/mdbtest$ g++ tutorial.cpp -i/usr/include/mongo/client -l/usr/lib -l/usr/lib/i386-linux-gnu/ -o tutorial /tmp/cc9l7bcw.o: in function __static_initialization_and_destruction_0(int, int)': tutorial.cpp:(.text+0x23f): undefined reference toboost::system::generic_category()' tutorial.cpp:(.text+0x249): undefined reference boost::system::generic_category()' tutorial.cpp:(.text+0x253): undefined reference toboost::system::system_category()' /tmp/cc9l7bcw.o: in function mongo::dbexception::dbexception(std::string const&, int)': tutorial.cpp:(.text._zn5mongo11dbexceptionc2erkssi[_zn5mongo11dbexceptionc5erkssi]+0x17): undefined reference tovtable mongo::dbexception' tutorial.cpp:(.text._zn5mongo11dbexceptionc2erkssi[_zn5mongo11dbexceptionc5erkssi]+0x4c): undefined reference mongo::dbexception::traceifneeded(mongo::dbexception const&)' /tmp/cc9l7bcw.o: in functionmongo::dbexception::~dbexception()': tutorial.cpp:(.text._zn5mongo11dbexceptiond2ev[_zn5mongo11dbexceptiond5ev]+0xd): undefined reference vtable mongo::dbexception' /tmp/cc9l7bcw.o: in functionmongo::userexception::userexception(int, std::string const&)': tutorial.cpp:(.text._zn5mongo13userexceptionc2eirkss[_zn5mongo13userexceptionc5eirkss]+0x24): undefined reference vtable mongo::userexception' /tmp/cc9l7bcw.o: in functionmongo::hostandport::init(char const*)': tutorial.cpp:(.text._zn5mongo11hostandport4initepkc[_zn5mongo11hostandport4initepkc]+0x29): undefined reference mongo::msgasserted(int, char const*)' tutorial.cpp:(.text._zn5mongo11hostandport4initepkc[_zn5mongo11hostandport4initepkc]+0x7c): undefined reference tomongo::msgasserted(int, char const*)' /tmp/cc9l7bcw.o: in function mongo::dbconnector::recv(mongo::message&)': tutorial.cpp:(.text._zn5mongo11dbconnector4recverns_7messagee[_zn5mongo11dbconnector4recverns_7messagee]+0x1e): undefined reference tomongo::verifyfailed(char const*, char const*, unsigned int)' /tmp/cc9l7bcw.o: in function mongo::dbclientinterface::~dbclientinterface()': tutorial.cpp:(.text._zn5mongo17dbclientinterfaced2ev[_zn5mongo17dbclientinterfaced5ev]+0xb): undefined reference tovtable mongo::dbclientinterface' /tmp/cc9l7bcw.o: in function mongo::dbclientinterface::dbclientinterface()': tutorial.cpp:(.text._zn5mongo17dbclientinterfacec2ev[_zn5mongo17dbclientinterfacec5ev]+0x16): undefined reference tovtable mongo::dbclientinterface' /tmp/cc9l7bcw.o: in function mongo::dbclientwithcommands::dbclientwithcommands()': tutorial.cpp:(.text._zn5mongo20dbclientwithcommandsc2ev[_zn5mongo20dbclientwithcommandsc5ev]+0x17): undefined reference tovtable mongo::dbclientwithcommands' /tmp/cc9l7bcw.o: in function mongo::dbclientwithcommands::~dbclientwithcommands()': tutorial.cpp:(.text._zn5mongo20dbclientwithcommandsd2ev[_zn5mongo20dbclientwithcommandsd5ev]+0xc): undefined reference tovtable mongo::dbclientwithcommands' /tmp/cc9l7bcw.o: in function mongo::dbclientbase::dbclientbase()': tutorial.cpp:(.text._zn5mongo12dbclientbasec2ev[_zn5mongo12dbclientbasec5ev]+0x25): undefined reference tovtable mongo::dbclientbase' tutorial.cpp:(.text._zn5mongo12dbclientbasec2ev[_zn5mongo12dbclientbasec5ev]+0x2f): undefined reference vtable mongo::dbclientbase' tutorial.cpp:(.text._zn5mongo12dbclientbasec2ev[_zn5mongo12dbclientbasec5ev]+0x50): undefined reference tomongo::dbclientbase::connectionidsequence' /tmp/cc9l7bcw.o: in function mongo::userexception::~userexception()': tutorial.cpp:(.text._zn5mongo13userexceptiond2ev[_zn5mongo13userexceptiond5ev]+0xb): undefined reference tovtable mongo::userexception' /tmp/cc9l7bcw.o: in function mongo::dbclientbase::~dbclientbase()': tutorial.cpp:(.text._zn5mongo12dbclientbased2ev[_zn5mongo12dbclientbased5ev]+0xb): undefined reference tovtable mongo::dbclientbase' tutorial.cpp:(.text._zn5mongo12dbclientbased2ev[_zn5mongo12dbclientbased5ev]+0x15): undefined reference vtable mongo::dbclientbase' /tmp/cc9l7bcw.o: in functionmongo::dbclientconnection::dbclientconnection(bool, mongo::dbclientreplicaset*, double)': tutorial.cpp:(.text._zn5mongo18dbclientconnectionc2ebpns_18dbclientreplicaseted[_zn5mongo18dbclientconnectionc5ebpns_18dbclientreplicaseted]+0x29): undefined reference vtable mongo::dbclientconnection' tutorial.cpp:(.text._zn5mongo18dbclientconnectionc2ebpns_18dbclientreplicaseted[_zn5mongo18dbclientconnectionc5ebpns_18dbclientreplicaseted]+0x33): undefined reference tovtable mongo::dbclientconnection' tutorial.cpp:(.text._zn5mongo18dbclientconnectionc2ebpns_18dbclientreplicaseted[_zn5mongo18dbclientconnectionc5ebpns_18dbclientreplicaseted]+0xc9): undefined reference mongo::dbclientconnection::_numconnections' /tmp/cc9l7bcw.o: in functionmongo::dbclientconnection::~dbclientconnection()': tutorial.cpp:(.text._zn5mongo18dbclientconnectiond2ev[_zn5mongo18dbclientconnectiond5ev]+0xc): undefined reference vtable mongo::dbclientconnection' tutorial.cpp:(.text._zn5mongo18dbclientconnectiond2ev[_zn5mongo18dbclientconnectiond5ev]+0x16): undefined reference tovtable mongo::dbclientconnection' tutorial.cpp:(.text._zn5mongo18dbclientconnectiond2ev[_zn5mongo18dbclientconnectiond5ev]+0x29): undefined reference mongo::dbclientconnection::_numconnections' /tmp/cc9l7bcw.o:(.gcc_except_table+0x38): undefined reference totypeinfo mongo::dbexception' /tmp/cc9l7bcw.o:(.rodata._ztvn5mongo16connectexceptione[_ztvn5mongo16connectexceptione]+0x18): undefined reference mongo::userexception::appendprefix(std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >&) const' /tmp/cc9l7bcw.o:(.rodata._ztvn5mongo16connectexceptione[_ztvn5mongo16connectexceptione]+0x20): undefined reference tomongo::dbexception::tostring() const' /tmp/cc9l7bcw.o:(.rodata._ztvn5mongo18assertionexceptione[_ztvn5mongo18assertionexceptione]+0x20): undefined reference mongo::dbexception::tostring() const' /tmp/cc9l7bcw.o:(.rodata._ztin5mongo16connectexceptione[_ztin5mongo16connectexceptione]+0x8): undefined reference totypeinfo mongo::userexception' /tmp/cc9l7bcw.o:(.rodata._ztin5mongo18assertionexceptione[_ztin5mongo18assertionexceptione]+0x8): undefined reference `typeinfo mongo::dbexception'


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -