Re: Tricky question about Microsoft C Runtime Libraries
From: xbunny (xbunny_at_eidosnet.co.uk)
Date: 02/17/04
- Next message: Joe \: "Re: Dijkstra gets it wrong [was: Re: D gets it right]"
- Previous message: Programmer Dude: "Re: Dijkstra gets it wrong [was: Re: D gets it right]"
- In reply to: fuh: "Tricky question about Microsoft C Runtime Libraries"
- Next in thread: fuh: "Re: Tricky question about Microsoft C Runtime Libraries"
- Reply: fuh: "Re: Tricky question about Microsoft C Runtime Libraries"
- Reply: fuh: "Re: Tricky question about Microsoft C Runtime Libraries"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 17 Feb 2004 19:09:33 +0000
fuh wrote:
> There are numerous C runtime libraries a win32 application or DLL may be
> linked against.
>
> Examples are singlethreaded static (/ML), multithreaded DLL (/MD) and
> multithreaded debug DLL (/MDD) .
>
> Is it possible to make a DLL use the runtime library used by application it
> is linked to?
Generally if the DLL is already linked to what its linked to
unfortunately thats it. For example if the dll is linked to one of the
static libraries then the crt is _statically_ linked into the dll
definately nothing you can do about that you couldnt even put a
different crt DLL in the path since it doesnt use one!
>
> Specifically I have an application that is compiled with /MD or /MDD
> depending on if it's a debug or release build. Depending on the compiler,
> this makes the application use mscvrt.dll, mscvr70.dll, mscvr70d.dll,
> mscvr71.dll, .... . I would like DLL's linked into the application to use
> this same runtime library (I do not want to compile a separate version of
> the DLL, one for each runtime library). The reason is so I can pass CRT
> objects from the application to the DLL without any problems.
>
> thanks.
However if the DLLs are not linked yet you can get round the compiler
switch (-MD, -MDd etc) that was included to compile them pretty easily.
Just apply -nodefaultlib to the linker and then specify the CRT library
for the link you want to use (ie msvcrt.lib).
Really though you probably want to find a design which doesnt involve
passing crt objects between seperate executable modules.
- Next message: Joe \: "Re: Dijkstra gets it wrong [was: Re: D gets it right]"
- Previous message: Programmer Dude: "Re: Dijkstra gets it wrong [was: Re: D gets it right]"
- In reply to: fuh: "Tricky question about Microsoft C Runtime Libraries"
- Next in thread: fuh: "Re: Tricky question about Microsoft C Runtime Libraries"
- Reply: fuh: "Re: Tricky question about Microsoft C Runtime Libraries"
- Reply: fuh: "Re: Tricky question about Microsoft C Runtime Libraries"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|