I I need to use MSVC v140
toolchain and QT v8.8.7
with an old version of OpenSSL
.
Both does’t support to mix debug and release builds out of the box.
Warning LNK2038: defaultlib '*library* ' conflicts with use of other libs; use /NODEFAULTLIB:*library*
It is not possible to build a static lib to be compatible to Debug and Release C runtime library (CRT) with msvc.
I found notes, that it is possible to change the version of the CRT in the exe project:
“If both the debug and release configuration use the same version of the CRT (e.g. Multi-threaded DLL (/MD)
) you can build your lib in release configuration and use it in release and debug configuration of your exe program (which will result in poorer debug support).”
How may I control this within my CMake Project
?
MS recommends to use the following options with the linker:
/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib
No idea how, and does this work?