Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1737

Driver fails to compile on MSVC 2017 with C++17 and no polyfill

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Following the instructions on http://mongocxx.org/mongocxx-v3/installation/

      And using the provided command:

      'C:\Program Files (x86)\CMake\bin\cmake.exe' -G "Visual Studio 15 2017 Win64"
          -DCMAKE_INSTALL_PREFIX=C:\mongo-cxx-driver
          -DCMAKE_PREFIX_PATH=C:\mongo-c-driver
          -DCMAKE_CXX_STANDARD=17
          -DCMAKE_CXX_FLAGS="/Zc:__cplusplus" ..
      

      r3.4.0 fails to compile with the following issues:

      mongo-cxx-driver-r3.4.0\src\mongocxx\options\private\transaction.hh(64): error C2440: 'return': cannot convert from 'initializer list' to 'std::optional<mongocxx::v_noabi::read_concern>' [mongo-cxx-driver-r3.4.0\build_win\src\mongocxx\mongocxx.vcxproj]
      
      mongo-cxx-driver-r3.4.0\src\mongocxx\options\private\transaction.hh(77): error C2440: 'return': cannot convert from 'initializer list' to 'std::optional<mongocxx::v_noabi::write_concern>' [mongo-cxx-driver-r3.4.0\build_win\src\mongocxx\mongocxx.vcxproj]
      
      mongo-cxx-driver-r3.4.0\src\mongocxx\options\private\transaction.hh(90): error C2440: 'return': cannot convert from 'initializer list' to 'std::optional<mongocxx::v_noabi::read_preference>' [mongo-cxx-driver-r3.4.0\build_win\src\mongocxx\mongocxx.vcxproj]
      

      FWIW I am compiling with the strictest warning level etc. etc.

            Assignee:
            Unassigned Unassigned
            Reporter:
            sbest.citadel Sacha Best
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: