delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/06/13/12:03:44

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: <3B27792F.8860720A@ece.gatech.edu>
Date: Wed, 13 Jun 2001 10:31:11 -0400
From: "Charles S. Wilson" <cwilson AT ece DOT gatech DOT edu>
X-Mailer: Mozilla 4.77 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Corinna Vinschen <cygwin AT cygwin DOT com>
Subject: Re: how to static link?
References: <20010613031121 DOT 22566 DOT qmail AT mail DOT com> <20010613110122 DOT F1144 AT cygbert DOT vinschen DOT de>


Corinna Vinschen wrote:
> 
> On Wed, Jun 13, 2001 at 11:11:21AM +0800, D G wrote:
> > I've tried linking with gcc -static, and even specified static libraries as /usr/X11R6/lib/libX11.a, but still cygwin produces a dynamically linked executable.  How can I compile a statically linked executable?
> 
> You can't. Cygwin isn't statically linkable.

Corinna is referring to the cygwin1.dll dependency.  However, the X11
libraries are ALSO only distributed as dll's --- that "libX11.a" file is
NOT a static lib.  It's an import lib for /usr/X11R6/bin/libX11.dll.

Some libraries are distributed in the cygwin package as both static libs
and as dll's (zlib, libpng, a few others).  You may use -static along
with certain compiletime flags to force static linking to *those*
libraries --- but you'll still be dynamically linked to cygwin1.dll and
the Xlibs.  For more information, see the README's in /usr/doc/Cygwin/

--Chuck

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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