Select a Runtime Library for Visual Studio code generation

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.