Reputation: 45
I am trying to install the C++ MongoDB 2.4 driver using this tutorial: http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-cpp-driver/
I downloaded and built the driver source code successfully using scons.
When I'm trying to compile the sample C++ file using the recommended command:
$ g++ tutorial.cpp -pthread -lmongoclient -lboost_thread-mt -lboost_filesystem -lboost_program_options -lboost_system -o tutorial
I get the following error:
/usr/lib/gcc/i686-linux-gnu/4.7/../../../../lib/libmongoclient.a(sock.o):
In function `mongo::SSLManager::setupPEM(std::string const&, std::string const&)':
(.text+0xc99): undefined reference to `SSL_CTX_use_certificate_chain_file'
/usr/lib/gcc/i686-linux-gnu/4.7/../../../../lib/libmongoclient.a(sock.o):
In function `mongo::SSLManager::setupPEM(std::string const&, std::string const&)':
(.text+0xceb): undefined reference to `SSL_CTX_set_default_passwd_cb_userdata'
I checked and I have already installed this packages: libssl1.0.0 libssl-dev.
Please help me!
Upvotes: 2
Views: 1924
Reputation: 66
Try compiling with crypto & ssl.
g++ tutorial.cpp -pthread -lmongoclient \
-lboost_thread -lboost_filesystem -lboost_program_options -lboost_system \
-lssl -lcrypto -o tutorial
Upvotes: 5