The Runtime Library has the following options: multithreading (/mt), multithreading debugging (/MTD), multithreading DLL (/MD), and multithreading debugging (/MDD). Sometimes, some external libraries are called, this option is incorrect. The old compilation fails;
C Runtime Library File
Single thread (static link) ml libc. Lib
Debug single thread (static link) MLD libcd. Lib
Multithread (static link) MT libcmt. Lib
Debug multithread (static link) MTD libcmtd. Lib
Multithread (Dynamic Link) MD msvert. Lib
Debug multithread (Dynamic Link) MDD msertd. Lib
Differences between various C Runtime libraries:
- Single-threaded library with static links
It can only be used for single-threaded applications. The target code of the C Runtime Library is eventually compiled into a binary file. You can use the/ml compilation option to set a single-threaded library that uses static links for Visual C ++.
- Multi-thread library with static links
The target code of the multi-threaded library with static links is finally compiled into the binary file of the application, but it can be used in multi-threaded applications. You can use the/MT compilation option to set a multi-thread library for Visual C ++ to use a static Link Library.
- Dynamic Link Runtime Library
The Runtime Library for dynamic connection stores all the C library functions in a separate dynamic link library msvcrxx. dll, which handles multithreading issues. You can use the/MD compilation option to set the Runtime Library that uses dynamic links in Visual C ++.
The target code of the static link will eventually be compiled into the binary file of the application.
The/MDD and/MTD options use the debug Runtime Library (the runtime function library of the debug version), which corresponds to the release version of/MD and Mt. The Runtime Library of the debug version contains debugging information, and uses some protection mechanisms to help identify errors and improve error detection. Therefore, its performance is inferior to that of the release version.