I created a .dll (with MFC static linking and Windows Runtime libraries statically linked as well) and I am linking to a library which uses boost for memory management (the library is PCL). Everything compiles ok with no errors, but I noticed that inside the library code, memory allocation is not working properly. For intance, the following line
indices_.reset (new std::vector<int>);
try {
indices_->resize (input_->points.size ());
}
allocates a new std::vector, does not throw any exception, but the vector is still empty after the resize function. Why should this be?
If i allocate the vector myself inside my own code for the DLL, the allocation works properly. But other errors arrise, such as strings that suddenly disappear (and the Visual Studio debugger shows "Error reading memory" when I hover on those strings).
I use static linking of the library to the DLL (and I am using static Runtime libraries, /MT).
What could be happening?