I use Visual Studio 2017 to open cmake projects. I have a debug application which uses MDd runtime library - CMAKE_CXX_FLAGS_DEBUG:/MDd /Zi /Ob0 /Od /RTC1
. When I try to link to a release static library (MD runtime) I get the following errors:
error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.cpp.obj
error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in main.cpp.obj
I can build a debug static library (MDd runtime library) and link to it but I wonder if there is any workaround for that issue ?