I want to use the Point Cloud Library PCL in C#. In order to do it I am writing a wrapper in C++/CLI that would have a managed class exposing the functions. However I encounter the following problem. When I use a "pure" dll with C# console application, it works nicely. However, when I link my dll (in C++/CLI) with PCL (by adding include and library folders to linker, VC++, and C++ in project properties and dependencies) and build it (with the exact same code, without even including the PCL files to the code, and then run the C# console app (which uses the wrapper) then, although it builds, it crashes when run with the following error: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt.". Like I said, the thing that causes it is simply linking the dll used in my project. Oh, and it's also worth noting that this happens only if I make an instance of a class from the wrapper in my C# code. Any idea why this happens and how to fix it? EDIT: it is not a duplicate of this one as it has nothing to do with Nvidia Manager, and is when I link a library. I see no similarities
EDIT2: I have narrowed down the error causing library to one of the libboost-xxx.lib not sure which one (since they mutually require each other to compile. Not sure how to solve it since PCL requires it, but the error clearly is with the boost libraries