3

I have successfully built the new libmongo-cxx-driver on Windows with Visual Studio, but I fail understanding how I can set up a project in VS 2015 to link to it. I would appreciate some help on that.

MatsB
  • 91
  • 1
  • 6
  • Somewhere within your visual studio project settings, there are three things you need to configure: the include path (the list of paths searched for header files), the library path (the paths searched for libraries named on the link line), and the list of libraries to link against. You should set the include path to be $PREFIX/{mongo,bson}cxx/v_noabi, the library path to be $PREFIX/lib, and then add mongocxx and bsoncxx (potentially with a leading 'lib' for static linking) to your list of libraries to link, where $PREFIX matches your CMAKE_INSTALL_PREFIX. – acm Oct 15 '16 at 16:07

1 Answers1

8

Vcpkg helps you get C and C++ libraries on Windows. if someone still finding a solution by 2017. here is the new way of compiling libraries

Download vcpkg follow the instructions as mentioned on git. https://github.com/Microsoft/vcpkg

Step 1 C:\vcpkg>.\vcpkg search mongodb

you will see something like this

mongo-c-driver 1.6.2-1 Client library written in C for MongoDB.

mongo-cxx-driver 3.1.1-1 MongoDB C++ Driver.

Step 2 C:.\vcpkg install mongo-cxx-driver

then grab a cup of coffee ...

Step 3

C:\vcpkg>.\vcpkg integrate install

Done..

Note Prerequisites:

Windows 10, 8.1, or 7

Visual Studio 2017 or Visual Studio 2015 Update 3

Answered by @JoyoWaseem How can I build a program using c++ driver of MongoDB?

Joyo Waseem
  • 680
  • 8
  • 25