Re: how to get .lib from .dll

From: Matt Taylor (para_at_tampabay.rr.com)
Date: 12/29/03


Date: Mon, 29 Dec 2003 05:54:04 +0000 (UTC)


"Tim Roberts" <timr@probo.com> wrote in message
news:i64vuv0a0sjflo7rlaqnon234fp012572n@4ax.com...
<snip>
> crtdll.dll contains a DLL version of the C runtime library. Everything in
> there is also available in LIBC.LIB, which has the advantage of linking
> directly with your application and avoiding another DLL load.
<snip>

Static linking is only appropriate if you have one single binary. Otherwise
you will get 2 copies of the C runtime. Not only is this larger, but it will
cause problems when trying to share things like buffers, FILE objects, and
other persistent C runtime data. I find it easier to dynamic link and
completely avoid such issues. You can link the C runtime dynamically by
using other libs such as libcmt.lib.

Also, it is worth pointing out that most libc functions are provided by the
Win32 system itself.

-Matt



Relevant Pages

  • Re: mfc size
    ... your DLL size but not solve any problems; and you cannot use such a DLL with any MFC ... MFC environment, so a DLL that does static linking will royally and totally fail (the app, ... for example, will not be able to find the window map for the windows created in the DLL, ...
    (microsoft.public.vc.mfc)
  • Re: Problem with reading an int with operator>>
    ... implemented in header files, is compiled into MSVCP60.DLL. ... Because it makes it impossible to patch std::string without rebuilding MSVCP60.DLL (if you use static linking). ... At the time the decision was made to include string in the DLL, it obviously wasn't known that it either had any bugs in or that there would be a problem with patching the DLL in an SP, which is obviously the normal way that library bugs are handled. ... I believe this allows MS to fix the CRT DLLs using Windows Update ...
    (microsoft.public.vc.stl)
  • Re: VC C++ 2005 sp1 "vcredist_x86.exe"
    ... It appears I now have to execute a package ... linking the run-time to the DLL linking? ... I don't believe we were doing static linking with the MSVC6 version, ... The manifest itself appears to contain direction mention of the VC8 DLL ...
    (microsoft.public.vc.language)
  • Re: perldoc -q "How can I make my Perl program run faster?"
    ... > it looks like you are using ActiveState Perl ... all link to libc, you probably get more performance gain out of not ... get from static linking, particularly if it causes you to swap more. ...
    (perl.beginners)
  • Re: VC++ 5 Q. - Shared DLL vs. statically linked lib?
    ... I decided to try statically linking MFC and to my surprise it only added around 150K to the program size. ... I'm not sure how much shared memory is created at run time, but I'm pretty convinced that static linking doesn't add that much overhead and it got rid of the need for a bunch of DLLs. ... I'm not running multiple apps - just the one standalone app. ... Unless you are running multiple applications that would use the DLL I don't think it would make much difference and you might want your application to be more standalone anyway just in case the world changes and your program continues to use the old paradigm. ...
    (microsoft.public.vc.mfc)