Home > Back-end >  How to make Visual Studio (2019/2022) link to the normal runtime libraries during a debug build?
How to make Visual Studio (2019/2022) link to the normal runtime libraries during a debug build?

Time:12-03

The reason I want to do this is because the debug libraries are littered with extra "assertion" statements that take ages to start with during remote debugging.

I hope it's only to replace Multi-threaded Debug DLL (/MDd) with Multi-threaded DLL (/MD) in Code Generation -> Runtime Library but I wonder if there are other changes one has to take into account as well?

CodePudding user response:

This is doable and also good practice for remote debugging big and complex applications also exlained in Mixing debug and release library/binary - bad practice?.

Besides switching link libraries from Multi-threaded Debug DLL (/MDd) to Multi-threaded DLL (/MD) one needs to take into account debug macros like _ITERATOR_DEBUG_LEVEL which might otherwise conflict during linking. A typical error message that indicates such a conflic is error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL'

Once all the conflicting macros have been resolved it will link to the standard runtime libraries but the debug symbols for the application remains.

Also, @Adrian Mole thanks for the assistans in this matter.

  • Related