none
What is the difference between Multi-Threaded DLL (/MD) and Multi-Threaded Runtime (/MT) libraries? RRS feed

  • Frage

  • As per the title, What is the difference between Multi-Threaded DLL (/MD) and Multi-Threaded Runtime (/MT) libraries?

    Should I have the DLL one if I'm building a DLL and the non-dll one when I'm building a typicall application?

    I got confused when I saw that the property page's default setting for this is /MD even when I'm building a normal application. I thought that something must be wrong here.

    Thus, what is their difference and which setting should I use in each case?

    Thanks in advance.

    Donnerstag, 1. November 2018 07:41

Alle Antworten

  • This question might be better asked on the Visual C++ forum.

    /MD makes your application require the C Runtime Library DLLs, e.g. ucrtbase.dll and vcruntime140.dll. /MT embeds the required parts of the C Runtime Library into your output file.

    /MD is generally better: it makes smaller files, the processes consume less RAM (because many processes can use the same C Runtime Library DLLs mapped to memory), and Microsoft can update the DLLs to fix bugs.

    However, you must use /MT if you are making an installer bootstrapper that needs to work even on computers in which the correct version of the C Runtime Library has not been installed yet. I suppose you could also use /MT if you were making some kind of plug-in and needed to isolate its CRT state from an ill-behaving host application.

    Donnerstag, 8. November 2018 16:33