Installing C++ driver on mac and ubuntu

19 views
Skip to first unread message

mpazqu...@gmail.com

unread,
Jul 23, 2016, 11:42:30 AM7/23/16
to mongodb-user
I'm trying to install the new c++ driver (right now on mac - later on ubuntu) with these instructions:

https://github.com/mongodb/mongo-cxx-driver/wiki/Quickstart-Guide-(New-Driver)#build-and-install-the-c-driver-1

to install the c driver I followed https://api.mongodb.com/c/current/installing.html

now I had installed pkg-config so I thought I was ok to leave out the ENVs it asks to set.

So I wrote

  • cd mongo-cxx-driver/build
  • cmake -DCMAKE_BUILD_TYPE=Release ..
  • make && sudo make install
When I make install - it installs into the build/install directory.  So it's not installing so I can use it with cmake.

I'd like to eventually get a setup shell script so I can do this on other machines - or at least jot down standard instructions to refer to.  Also it would be nice to get a cmake snippet for writing a small bson document to localhost.

David Golden

unread,
Jul 25, 2016, 9:59:53 AM7/25/16
to mongodb-user
The default install path is 'build/install'.  In your 'cmake' line, you just need to add -DCMAKE_INSTALL_PREFIX=... with wherever you want the C++ driver actually installed, such as '/usr/local/' and then it should all work as you expect.

I'm going to update the Wiki to try to clarify that point as you're not the first one with that complaint.

Regards,
David
Reply all
Reply to author
Forward
0 new messages