We receive a ready compiled lib from a partner only as a release version. As expected it works fine for our release build but it also worked fine while using it in the debug build (for our internal tests or debugging sessions)
Now some changes happened and the newest version of the libs don't work any more in debug build I get the Error
mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
I understand why it happens now, but I don't understand why it didn't occur in the old version. The older version also had the wrong RuntimeLibrary set but somehow it did not affect the linker...? ( I used DUMPBIN to look for the flags)
We think we found the problem: only one obj in the library uses C++/STL functionality This was not used (by us) in the earlier version of the lib. But they changed some other functions and now they use these functions -> linker is adding now the C++ Code and rightfully complaining about it.
Further finding: you can mix debug/release code, as long as you don't use anything from the runtime library.