Re: [Mingw-msys] auto<stuff> troubles.
- Date: Wed, 14 Nov 2007 10:16:24 -0800
- From: Brian Dessent <brian@xxxxxxxxxxx>
- Subject: Re: [Mingw-msys] Some questions about the mingw-runtime .a files
Bo Yang wrote:
> So, how MinGW gcc link a program. When you use options such as
> -lkernel32, how the MinGW gcc and ld works? They link to the
> libkernel32.a at the lib directory of MinGW, right? And the
> libkernel32.a is just a import library for the real dll file
> kernel32.dll, am I right?
I don't understand the question. You seem to be thinking that somehow
the code inside kernel32.dll is needed by the linker when linking a
program that makes calls into kernel32.dll, but that is not the case at
all -- the DLL is needed only at runtime, not linktime.
In fact that is exactly why *shared* libraries are shared as opposed to
static: the code resides in one place and all users of it can simply
call it. The code is not duplicated/copied into every program as with
static linking. All the linker needs is the import library, which
simply enumerates the interfaces that the DLL exports.
Brian
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Mingw-msys mailing list
Mingw-msys@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/mingw-msys