Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <39F5DB77.DE6DC590@ece.gatech.edu> Date: Tue, 24 Oct 2000 14:56:55 -0400 From: Charles Wilson X-Mailer: Mozilla 4.7 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: "Henry S. Thompson" CC: cygwin AT sources DOT redhat DOT com Subject: Re: DLL naming flamefest References: <39F54E98 DOT 7130D9BC AT ece DOT gatech DOT edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Henry S. Thompson" wrote: > > This sounds viable, in so far as I understand it :-) > > One question -- for compiling and linking from WIN32, i.e. with VC++, > I had _serious_ trouble in this area just last week. I think what I > needed to know but couldn't find out is what the equivalent of > -Bstatic is for VC++ -- is that a coherent question? > There seem to be two issues: 1) how can you instruct VC++ to link using a static lib or using a dll import lib? 2) can VC++ even use cygwin statlibs or cygwin implibs? I *think* the answer to #2 is "you can't". So question #1 is probably moot. I know that VC++ doesn't use ".dll.a" for import libs so that's a non-issue. In fact, I believe libraries are named ".lib" not "lib.a", so unless you explicitly list the full name and path of the cygwin library you want to link, VC++ won't find them (even if it *could* use them). But, if you give full name and path -- then you don't need to worry about some esoteric "search order". Going back to question #1, suppose that there are two *native* libraries -- foo.lib (or libfoo.lib? a static lib) and foo.a (??? a dynamic import lib). How do you tell VC++ to link with foo.lib vs. foo.a ? I dunno, but I think MS sidesteps the issue by using *Completely Different Lib Names* for dynamic vs. static. e.g. the static runtime is libc.lib but the dynamic runtime implib is msvcrt.lib. If you use completely different names for the same library, where one variant is an implib for a dll and the other variant is a statlib, then you don't *need* a '-Bstatic' switch. Perhaps that's MS's solution to the problem. We (gcc/cygwin/unix-in-general) want the same (base)name for identical libraries, and use suffixes to distinguish implibs (so's) from statlibs. So, we munge our linker to understand suffixes according to some (arbitrary) convention. The convention we chose is: .a means statlib (but maybe implib -- backwards compatible holdover); .dll.a means implib; .dll means dll. On unix, .so (or .sl -- HPUX) means sharedlib. However, further discussions of VC++ vagaries are probably off topic for this list. -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com