Is it possible to use to use libs compiled with /MT in C++ CLR? It throws me either a ton of LNK2022 “metadata operation failed (8013118D)” errors (if I use /MD in the CLR project) or ” ‘/MT’ and ‘/clr:pure’ command-line options are incompatible” if I use /MT.
What do I need to change in the library? The library is mine, but it includes several third party static libs.
LNK2022 are a pain to pinpoint. It usually means one of your module’s configuration affecting structure layout is different from the others.
Check for the following usual causes:
You can use /d1reportSingleClassLayout_your-class-name_ (without space) to get information about the problematic class’ layout.
For more information see : Diagnosing Hidden ODR Violations in Visual C++