Search code examples
mongodbmongo-cxx-driver

Mongocxx-driver doesn't build during installation


I'm following the tutorial at http://mongocxx.org/mongocxx-v3/installation/ . I have successfully compiled/installed c driver as described at http://mongoc.org/libmongoc/current/installing.html. However, when building the cxx driver using

cmake.exe -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=C:\mongo-cxx-driver -DCMAKE_PREFIX_PATH=C:\mongo-c-driver -DBSONCXX_POLY_USE_BOOST=1 -DBOOST_ROOT=C:\boost\boost_1_59_0 ..
msbuild.exe ALL_BUILD.vcxproj

I receive the following errors:

"D:\mongo-inst\mongo-cxx-driver\build\ALL_BUILD.vcxproj" (default target) (1) ->
"D:\mongo-inst\mongo-cxx-driver\build\src\mongocxx\mongocxx.vcxproj" (default target) (5) ->
(ClCompile target) ->
  D:\mongo-inst\mongo-cxx-driver\src\mongocxx\gridfs\downloader.cpp(80): error C2593: 'operator =' is ambiguous [D:\mongo-inst\mongo-cxx-driver\build\src\mongocxx\mongocxx.vcxproj]


"D:\mongo-inst\mongo-cxx-driver\build\ALL_BUILD.vcxproj" (default target) (1) ->
"D:\mongo-inst\mongo-cxx-driver\build\src\mongocxx\mongocxx_mocked.vcxproj" (default target) (6) ->
  D:\mongo-inst\mongo-cxx-driver\src\mongocxx\gridfs\downloader.cpp(80): error C2593: 'operator =' is ambiguous [D:\mongo-inst\mongo-cxx-driver\build\src\mongocxx\mongocxx_mocked.vcxproj]

I've already tried installing different versions of c driver such as 1.13.0(which is the requirement for cxx-driver version 3.4.0), 1.15.0 and 1.14.1 but it didn't help.


Solution

  • I solved the issue and it seems to stem from the boost version I used. Instead of 1.59, using 1.60 for boost version solved my issues.