Hey,
I am trying to build mongo-cxx-driver on windows and hitting some issues. Has anyone been able to build the latest release(r3.7.0)? I didn’t have an issue with r3.6.7.
The issue seems to be related with pollyfill but not sure what changed as yet.
Usually build with polyfill disabled but it seems in that case bsoncxx automatically enables polyfill.
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=C:_deps\mongodb -DCMAKE_CXX_FLAGS=’/Zc:__cplusplus’ -DCMAKE_CXX_STANDARD=17 …
01:50:38 -- Auto-configuring bsoncxx to use C++17 std library polyfills since C++17 is active and user didn't specify otherwise
01:50:38 bsoncxx version: 3.7.0
Which leads to this error
82>C:\conan\.conan\data\mongo-cxx-driver\3.7.0\nemtech\stable\package\ba80356c2e9b1444ad652db7a781f16d357b0c49\include\bsoncxx\v_noabi\bsoncxx/stdx/make_unique.hpp(66,1): fatal error C1189: #error: "Cannot find a valid polyfill for make_unique" [C:\tmp\_build\extensions\mongo\tests\test\tests.catapult.test.mongo.vcxproj]
Now I am trying to enable polyfill using boost
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=C:\Users\wayon\code\symbol\symbol\client\catapult\_deps\mongodb -DBOOST_ROOT=C:\Users\wayon\code\symbol\symbol\client\catapult\_deps\boost -DCMAKE_CXX_STANDARD=17 -DBSONCXX_POLY_USE_BOOST=1 ..
This leads to unresolve symbol for boost.
Creating library C:/Users/wayon/code/symbol/symbol/client/catapult/_deps/source/mongo-cxx-driver/_build/src/mongocxx/Debug/mongocxx-mocked.lib and object C:/Users/wayon/code/symbol/symbol/client/catapult/_deps/source/mongo-cxx-driver/_build/src/mongocxx/Debug/mong
ocxx-mocked.exp
collection.obj : error LNK2019: unresolved external symbol "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@boost@@YAXAEBVexception@std@@@Z) referenced in function "public: class mongocxx::v_noabi::result::bulk_write & __cdecl boost
::optional<class mongocxx::v_noabi::result::bulk_write>::value(void)& " (?value@?$optional@Vbulk_write@result@v_noabi@mongocxx@@@boost@@QEGAAAEAVbulk_write@result@v_noabi@mongocxx@@XZ) [C:\Users\wayon\code\symbol\symbol\client\catapult\_deps\source\mongo-cxx-driver\_bu
ild\src\mongocxx\mongocxx_mocked.vcxproj]
change_stream.cpp.obj : error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@boost@@YAXAEBVexception@std@@@Z) [C:\Users\wayon\code\symbol\symbol\client\catapult\_deps\source\mongo-cxx-driver\_bu
ild\src\mongocxx\mongocxx_mocked.vcxproj]
C:\Users\wayon\code\symbol\symbol\client\catapult\_deps\source\mongo-cxx-driver\_build\src\mongocxx\Debug\mongocxx-mocked.dll : fatal error LNK1120: 1 unresolved externals [C:\Users\wayon\code\symbol\symbol\client\catapult\_deps\source\mongo-cxx-driver\_build\src\mongo
cxx\mongocxx_mocked.vcxproj]