[CXX-1737] Driver fails to compile on MSVC 2017 with C++17 and no polyfill Created: 13/Feb/19  Updated: 02/Mar/20  Resolved: 13/Feb/19

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Sacha Best Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates CXX-1688 MongoDB CXX driver does not compile w... Closed

 Description   

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.



 Comments   
Comment by Kevin Albertson [ 02/Mar/20 ]

Hi mika.fischer@zoopnet.de, this is fixed in a duplicate ticket CXX-1688 and additionally CXX-1689. Those will both be included in the upcoming 3.4.1 release, which should be coming this week.

Comment by Mika Fischer [ 02/Mar/20 ]

Any idea when this will happen? Or any patch that we can cherry-pick? It's been over a year...

Comment by Sacha Best [ 13/Feb/19 ]

Hi Kevin - sorry for filing a duplicate. Glad to hear its fixed and I appreciate the quick response.

Comment by Kevin Albertson [ 13/Feb/19 ]

Hi Sacha,

Thank you for the report. This is fixed on master as part of CXX-1688 and will be included in the next release.

Best,
Kevin

Comment by Sacha Best [ 13/Feb/19 ]

Sorry, forgot to set version info in the header and now I cannot modify this ticket.

Affected versions are at minimum 3.4.0

Generated at Wed Feb 07 22:03:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.