Hello!
Is there any way to make static libraries built in Microsoft Visual Studio independent from used CRT (with debug support / without it)?
I mean like, for simple C library it is possible to generate code using gcc
and then use the same static library in visual studio. The resulting library.a
file is completely independent from /MT
or /MDd
switches and does not result in warning / linking errors.
Comparing to Visual Studio default behaviour, you would have to build two versions of the same library - for Debug / Release modes independently. If you try to use the Release
version in Debug configuration or vice-versa, this results in ugly warnings (warning LNK4098: defaultlib "LIBCMT" ...
), but sometimes does not compile due to different runtimes?
Is there any way to avoid this? Or probably I'm doing something wrong?