
The C++/CLI wrappers work fine when they are dynamically linked, but they cause a runtime initialization error (0xc000007b) whenever they are connected in only static links.
I had a similar problem when I tried to use boost within a CLR program. When I rebuilt the boost libraries with the /CLR option, the problem went away. There is a thunking layer that takes place between managed and unmanaged code. If you statically link managed code with unmanaged code, the link will take place just fine and fool you into believing the program is going to run. But at runtime, the CLI tries to load and link the pieces of the code together, and when it fails, it aborts with the 0xC000007b error. Building the boost libraries with the /CLR option makes boost managed-code as well. You may want to have two sets of boost libraries. One set for C++ applications, and another set for CLI applications. -Sid Sacek