Hi
I followed Getting Started with MongoDB and C++ | MongoDB
I have built the following correctly on windows 10.
- mongo-cxx-driver-r3.8.0
- mongo-c-driver-1.24.1
- boost_1_82_0
and I have all libs available now,
- mongocxx.lib
- bsoncxx.lib
- bson-1.0.lib
- bson-static-1.0.lib
- mongoc-1.0.lib
- mongoc-static-1.0.lib
- libboost_system-vc142-mt-gd-x64-1_82.lib
- libboost_filesystem-vc142-mt-gd-x64-1_82.lib
- libboost_thread-vc142-mt-gd-x64-1_82.lib
- libboost_date_time-vc142-mt-gd-x64-1_82.lib
Now I need to use Mongo DB c++ in the VS2019 x64 DLL project, I have all C++ include paths and lib paths and libs in linker when I include #include <mongocxx/client.hpp>
in my cpp file and building the project, I get many errors. look like this is only for a DLL project. is there any macro to define in the preprocessor? I already tried MONGOCXX_EXPORTS
but still, the same errors appeared …
very 1st error
create_collection_deprecated& max(std::int64_t max_documents)
Error (active) E0106 invalid type for a bit field DataBase 103 libs\mongo-cxx-driver-r3.8.0\src\mongocxx\options\create_collection.hpp
find& max(bsoncxx::document::view_or_value max)
Error C2146 syntax error: missing ')' before identifier 'max' DataBase 301
\libs\mongo-cxx-driver-r3.8.0\src\mongocxx\options\find.hpp
I get errors in
- find_one_and_delete.hpp
- find_one_and_replace.hpp
- delete.hpp
- insert_many.hpp
- replace_one.hpp
- update.hpp
- collection.hpp
I guess the same issue is mentioned on another topic Can build console app with mongocxx but not DLL project VS2019