问题
I have build the mongodb cxx binaries in windows following the steps described here.
I have created the Test application as mentioned in the steps.
On release builds, the application throws bad allocation
exception:
std::bad_alloc at memory location 0x0047EB60
] in this line :
mongocxx::uri muri{ uri_string };
The same code works with Debug build.
Could someone please help me to fix the issue in Release build ?
回答1:
My issue got resolved after I built mongocxx and bsoncxx in Release and used that. Previously I built those in Debug and Test Application in release. Need to match the target configuration.
来源:https://stackoverflow.com/questions/44884079/mongodb-cxx-driver-test-crashing-in-release-build-works-fine-in-debug