Re: /MT and /MD
- From: "Ben Voigt" <bvoigt@xxxxxxxxxxxxx>
- Date: Wed, 22 Mar 2006 09:35:47 -0600
"Frederico Pissarra" <frederico@xxxxxxxxxxx> wrote in message
news:%234KaKEcTGHA.2276@xxxxxxxxxxxxxxxxxxxxxxx
As "Carl Daniel" explained, with /MT and /MD you choose between LIBCMT
(LIBC for Multi Threaded Apps) and MSVCRT (MS Visual C++ Run Time DLL).
No debug info implied here! Use can use MSVCRT to share runtime code
between apps - makes your apps smaller!)...
If you want to link all runtime code to your app you can use /MT (or /ML
if you aren't using threads). If you don't want all that stuff in your EXE
or DLL, you can use /MD
To link libs with debug info just add another 'd' at the end of the
option: /MTd, /MDd or /MLd.
marco, what's going on, although no one quite said it, is that you can have
a debug exe using the release runtime library, if you don't need to see
what's going on inside the library.
Of /MT, /MD, /MTd, /MDd, only /MDd references a debug DLL that will break
your program on other computers.
/MTd puts the entire CRT library (printf, malloc and so forth) and its debug
information inside your application, with library assertions turned on.
/MT puts the entire CRT library inside your application without any
associated debug information, though your code can still have debug
information and/or assertions turned on.
/MD makes your app look at the MSVCRT dll which has no debug information.
Again your code can still use debug information and assertions.
[]s
Fred
"Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
escreveu na mensagem news:ueuzxCVTGHA.4520@xxxxxxxxxxxxxxxxxxxxxxx
"marco 2" <rebel-6-out@xxxxxxxxx> wrote in message
news:44209ffd$0$2024$ba620dc5@xxxxxxxxxxxxxxxxxxxxxx
are >all< libraries and dll's (which the executable depends upon)
statically linked
into the executable in /MT mode???
No, not at all. /MT vs /MD simply changes the DEFAULTLIB linker
directive that the compiler emits into the object file(s) that tells the
linker which CRT library to link with. Any other libraries are your
responsibility. A given library is either a static library or a DLL
import library - you don't have a choice to link it one way or the other.
-cd
.
- Follow-Ups:
- Re: /MT and /MD
- From: marco 2
- Re: /MT and /MD
- References:
- /MT and /MD
- From: marco 2
- Re: /MT and /MD
- From: marco 2
- Re: /MT and /MD
- From: Carl Daniel [VC++ MVP]
- Re: /MT and /MD
- From: marco 2
- Re: /MT and /MD
- From: Carl Daniel [VC++ MVP]
- Re: /MT and /MD
- From: Frederico Pissarra
- /MT and /MD
- Prev by Date: Re: Singleton and Inheritance
- Next by Date: Re: converting VC 4.2 to VC6.0
- Previous by thread: Re: /MT and /MD
- Next by thread: Re: /MT and /MD
- Index(es):
Relevant Pages
|
Loading