You are not logged in.
Hey there,
I am attempting to compile a simple code that connects to a MongoDB server in C++.
Here are the simple instructions to install the C++ Driver
http://docs.mongodb.org/ecosystem/tutor … cpp-driver
Just download and run scons to build. They recommend boost 1.49 and I have boost 1.54, but I suspect the document is a little outdated.
I have a sample program that I am trying to compile with this statement.
g++ mclient.cpp -pthread -lmongoclient -lboost_filesystem -lboost_program_options -lboost_system -lboost_thread-mt -o tutorial
But I get the error
/usr/bin/ld: cannot find -lboost_thread-mt
collect2: error: ld returned 1 exit status
It compiles if I take out -lboost_thread-mt
Can anyone help me solve this error?
Thanks!
Last edited by Aquila (2013-10-17 17:09:08)
Offline
Hi
you can test with -llibboost_filesystem -llibboost_program_options -llibboost_system -llibboost_thread
Offline
Hi there,
I tried
g++ mclient.cpp -llibboost_filesystem -llibboost_program_options -llibboost_system -llibboost_thread -o tutorial
and received
/usr/bin/ld: cannot find -llibboost_filesystem
/usr/bin/ld: cannot find -llibboost_program_options
/usr/bin/ld: cannot find -llibboost_system
/usr/bin/ld: cannot find -llibboost_thread
collect2: error: ld returned 1 exit status
Offline
$ ls /usr/include/boost | grep thread
thread
thread.hppTry without the leading -mt?
Offline
Thanks! I took off the -mt from -lboost-_thread-mt and it compiles
Offline