Re: /MD vs /MT
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Wed, 28 May 2008 10:58:50 -0500
On Wed, 28 May 2008 00:57:57 -0700 (PDT), mathieu
<mathieu.malaterre@xxxxxxxxx> wrote:
If the C++ class is shared between modules (EXE and DLLs), you almost
certainly have the "Case 1" scenario described above.
Do you mean inline member function being both in the DLL and the EXE,
for example ?
Yes, but I also include classes shared through exporting. If you want a
program composed of EXE and DLLs to act like a real C++ program, as opposed
to a collection of independent modules, you have to link everyone to the
same CRT DLL. As you seem to be coming from a Unix background, you should
be aware that the Unix and Windows dynamic linking models are very
different. There used to be a manuscript for Levine's book "Linkers &
Loaders" available at iecc.com, but I'm getting "Forbidden" errors now;
this book talks about it in some detail. In a nutshell, Unix maintains
enough state to perform something close to a static link when it
dynamically links two modules, while Windows relies on a more formal
import/export model. Each approach has its advantages; for example, Unix
comes closer to traditional linking without imposing new burdens, while
Windows helps with data hiding and order of initialization of globals in
different modules. For disadvantages, exchange Unix/Windows and negate the
statements of the previous sentence.
--
Doug Harrison
Visual C++ MVP
.
- Follow-Ups:
- Re: /MD vs /MT
- From: mathieu
- Re: /MD vs /MT
- References:
- /MD vs /MT
- From: mathieu
- Re: /MD vs /MT
- From: Doug Harrison [MVP]
- Re: /MD vs /MT
- From: mathieu
- /MD vs /MT
- Prev by Date: Re: Hidding a program from Windows toolbar
- Next by Date: Re: error C2511: overloaded member function ~~~ not found in 'CEdit'
- Previous by thread: Re: /MD vs /MT
- Next by thread: Re: /MD vs /MT
- Index(es):
Relevant Pages
|