tags: visual studio Compilation options
###Date: 2017/10/23
Location of compilation options:
Properties -> C/C++ -> Code Generation -> Runtime Library
(1)/MD
Make applications use multithreaded and DLL-specific versions of the runtime library. Define _MT and _DLL and make the compiler put the library name MSVCRT.lib in the .obj file.Applications compiled with this option are statically linked to MSVCRT.lib. The library provides a code layer that allows the linker to resolve external references. The actual working code is contained in MSVCR90.DLL, and the library must be available to applications linked with MSVCRT.lib at runtime.When /MD is used with the _STATIC_CPPLIB preprocessor definition (/D_STATIC_CPPLIB), your application will link with the static multithreaded standard C++ (libcpmt.lib) instead of the dynamic version (msvcprt.lib), but still through msvcrt. lib is dynamically linked to the main CRT.Create a debug DLL. Define _MT and _DEBUG.
Precautions:
/MD indicates that the runtime library is not integrated, the generated file is small, and the corresponding DLL is dynamically loaded when the program is run;
/MT means run-time library integration, and the generated file is large. When linking, the C/C++ run-time library is integrated into the program to become the code of the program.
The C runtime library is actually an implementation of standard C/C++ library functions. The compiler in VC++ provides dll to implement C/C++ library functions.
The reason for choosing /MD: the file is small, the same heap is used, and there is no problem of A applying and B releasing;
The reason for choosing /MT: good portability and less dependence.Reference: http://blog.csdn.net/whatday/article/details/7933133
http://blog.sina.com.cn/s/blog_6f7265cf0101nhs0.html
http://blog.csdn.net/u010059658/article/details/51026662
http://www.cnblogs.com/cuish/p/3146937.html
Transfer from: http://blog.csdn.net/caoshangpa/article/details/51416077 1. Set the runtime library in pro Recently, the following error occurred when using Qt5.6.0 (VS2013 version) to call a static li...
In the development of the window program is often encountered when the compiled program is not able to run on another machine, which is generally caused by the installation of the corresponding runtim...
Transfer from: The project development process encountered MSVCRTD.LIB and LIBCMTD.LIB conflicts, and later found the reason is that the code compiler compile c / c + + runtime version is not the same...
reference: Openssl source download address:https://www.openssl.org/source/I used openssl-1.1.0i First install ActivePerl:https://www.activestate.com/activeperl/downloadsAfter loading it, if you start ...
Where do you start talking about this topic? The blogger Xiaobai one, recently debugged the program (WIN-MSVC) and did not understand some basic problems, in line with the principle of meeting the pro...
In VS, there are four options in project properties-"C/C++-"Code generation -" runtime library options: multi-threaded (/MT), multi-threaded debugging (/MTd) , Multi-threaded DLL (/MD),...
Qt sets the runtime library MT, MTd, MD, MDd in pro, focusing onQMAKE_CFLAGS Multi-threaded debugging Dll (/MDd) corresponds to MD_DynamicDebug Multi-threaded Dll (/MD) corresponds to MD_DynamicReleas...
Articles directory 0. Foreword 1. How to set up 1.1 Cmakelists code 1.2 Point 1: Policy 1.3 Key points 2: set_proprty 0. Foreword existMSVCEngineeringRight-click-> Properties,turn upConfiguration a...
Article Directory 1. Open the project 2. Modify options 3. Verification test In an embedded running environment, most of the host software may use the MD mode to load and run the C++ runtime library. ...
Let’s summarize their differences here. The 'd' behind represents the DEBUG version, and the RELEASE version without 'd' is the RELEASE version. First of all, /MT /MT is "multithread, stati...