0

I have a c++ static library, which I want to use in c#. What I tried was to use c++/Cli. The Problem is, that I get
"mismatch detection Errors for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug'" because the library is using MTd as runtime library.

The Problem is, that I can't change the runtime Library to MTd, because clr does not support it.

Is there any Workaround, or what would be a different approach to create a wrapper, which I can use c#.

Thank you all for your help.

Sebastian Kilb
  • 286
  • 1
  • 9
  • Possible duplicate of [Call C++ library in C#](https://stackoverflow.com/questions/574801/call-c-library-in-c-sharp) – SᴇM Jan 23 '18 at 13:47
  • This is a rock-hard limitation. Very irresponsible of the library author to not make a /MD build available, the runtime errors you get from having multiple copies of the CRT in a single process are very hard to diagnose and almost impossible to fix. Isolating the library in its own native DLL makes the link errors go away, but not the runtime misery. Use a telephone to demand the proper build. You'll need him again when you update your VS version. – Hans Passant Jan 23 '18 at 15:07
  • @HansPassant this will probably not happen, because the library I'm talking about ist WebRTC, which is maintained by Google. But thank you for your help – Sebastian Kilb Jan 23 '18 at 16:19
  • 2
    Google always supplies source code, just rebuild the library. https://webrtc.googlesource.com/src – Hans Passant Jan 23 '18 at 16:21
  • @HansPassant yes I know and I built the libs using the source Code. I also found out how to Change the runtime library build to MD. However I am still fighting with some linking Errors. But Google /WebRTC build does not Support to build a DLL infact they even return an error message when you try to build it with a shared library parameter. – Sebastian Kilb Jan 24 '18 at 13:04

0 Answers0