i am trying to use functions and classes defined in a native c++ library in .NET via a c++/cli
wrapper bridge. this works fine, but as soon as i include certain Boost headers
(e.g. boost/filesystem.hpp) in the native library, the c# program crashes with error
message: "ModuleLoadException: The C++ module failed to load during native initialization"
I guess that i am not including a reference to the boost lib correctly. My approach is:
1. compile c++/cli wrapper (which includes header to the native classes/functions)
cl.exe /c /clr /MD wrapper.cpp
2. compile c#
csc /target:module /addmodule:wrapper.obj tool.cs
3. link everything including the native library lib0.lib
link /LTCG /CLRIMAGETYPE:IJW /ENTRY:Tool.Program.Main /SUBSYSTEM:CONSOLE
/OUT:tool.exe wrapper.obj tool.netmodule lib0.lib
Most grateful for any hints!
View Complete Post