delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/10/24/14:58:02

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <cwilson AT ece DOT gatech DOT edu>
X-Mailer: Mozilla 4.7 [en] (X11; U; SunOS 5.7 sun4u)
X-Accept-Language: en
MIME-Version: 1.0
To: "Henry S. Thompson" <ht AT cogsci DOT ed DOT ac DOT uk>
CC: cygwin AT sources DOT redhat DOT com
Subject: Re: DLL naming flamefest
References: <39F54E98 DOT 7130D9BC AT ece DOT gatech DOT edu> <f5blmvetsy7 DOT fsf AT cogsci DOT ed DOT ac DOT uk>

"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 "<name>.lib" not
"lib<name>.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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019