I am running a C# application that references a C++\CLI wrapper project which in turn references a native c++ project dependent on Boost 1.47 library (links to files of the form ...vc100-mt-gd-1_47.lib)
All libraries are statically linked and everything compiles great. Executing the C# app results in an exception: "...is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)." claiming some dependency is missing somewhere.
C# application is configured to x86 platform while all other projects are Win32, including boost's binaries.
EDIT: before adding the use of Boost library, it DID work
How can I track down the problem?
It is known issue. The reason is Thread Local Storage (TLS) used in the Boost::Thread. To fix it you should either disable libboost_thread-vcXXX-mt-1_XX.lib and force linker to link your C++/CLI assembly with boost_thread-vcXXX-mt-1_XX.lib (stub of the boost_thread-vcXXX-mt-1_XX.dll).
Or you can create your own DLL and link it with libboost_thread-vcXXX-mt-1_XX.lib. Then you can link your C++ DLL with C++/CLI assembly.
See
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With