Search code examples
c++windowsmongodbreleasemongo-cxx-driver

Mongodb Cxx Driver Test crashing in Release Build [ Works fine in Debug ]


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 ?


Solution

  • 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.