Re: /MT and /MD



"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






.



Relevant Pages

  • Re: Nasty Problem
    ... There is no dll main as it is not needed. ... The apps generally do not run at the same time. ... I have removed all MessageBox calls in my other app but it still ... what libraries would MessageBox require (implicitly ...
    (microsoft.public.dotnet.languages.vc)
  • Re: C run-time library
    ... >Debug Single-Threaded ... >Debug Multithreaded DLL ... to provide a comprehensive selection of libraries, ...
    (microsoft.public.vc.language)
  • Re: /MT and /MD
    ... for Multi Threaded Apps) and MSVCRT (MS Visual C++ Run Time DLL). ... To link libs with debug info just add another 'd' at the end of the option: ... Any other libraries are your ...
    (microsoft.public.vc.language)
  • Re: Nasty Problem
    ... There is no dll main as it is not needed. ... The apps generally do not run at the same time. ... I have removed all MessageBox calls in my other app but it still crash ... what libraries would MessageBox require (implicitly ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Visual Basic for Autorun?
    ... > Realistically the point is preventing other coders mucking things up ... This is ok but it requires a bit of effort to keep everything in sync between the apps. ... If you don't use ocxs or dll then all of the code has to be loaded all of the time. ... You can move libraries in and out of the IDE just by simply adding and removing them, you get the best of both worlds. ...
    (microsoft.public.vb.general.discussion)

Loading