Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm list-help: list-post: Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-apps AT sourceware DOT cygnus DOT com From: Chris Faylor Date: Wed, 17 May 2000 06:05:24 -0400 To: "cygwin-apps AT sourceware DOT cygnus DOT com" Subject: Re: Shared vs Static [WAS: Re: [general] some ideas & request for comments (LONG)] Message-ID: <20000517060524.A1059@cygnus.com> Mail-Followup-To: cgf AT cygnus DOT com, "cygwin-apps AT sourceware DOT cygnus DOT com" References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.1.12i In-Reply-To: ; from Michael.Ring@t-mobil.de on Wed, May 17, 2000 at 07:54:55AM +0000 On Wed, May 17, 2000 at 07:54:55AM +0000, Michael Ring wrote: >>In '-Bstatic', you'd only look for 'libfoo.a' of course. >> >>--Chuck > >Why is the actual DLL the first thing that has to be searched? > >>From my understanding the first thing to use is the import-library, if it >exists. > >Think about the cygwin1.dll example. If you would first try to link with the >actual dll, you would run into an 'unresolved external' problem if some kind of >name-mangling is done in the import-library. > >So search order should be: > >libfoo.dll.a foo.dll.a libfoo.dll foo.dll libfoo.a > >Correct or wrong ???? I'm not sure what name mangling has to do with this, but actually, there is another reason to search the .a file before the .dll file. libcygwin.a contains references to things in cygwin1.dll *and* it contains "static" references. If you link cygwin1.dll first you will get unresolved symbols. So, you can't do things this way. cgf