delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/29/21:15: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: <3AC3DEFD.A3A2B2FB@ece.gatech.edu>
Date: Thu, 29 Mar 2001 20:18:53 -0500
From: "Charles S. Wilson" <cwilson AT ece DOT gatech DOT edu>
X-Mailer: Mozilla 4.75 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Mark Paulus <commpg AT yahoo DOT com>
CC: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: Statically linking programs??
References: <200103292359 DOT f2TNx5e11276 AT mail DOT ee DOT gatech DOT edu>


Mark Paulus wrote:
> 
> I was looking through the FAQ, and I see about an option to
> build binaries that link either the cygwin or the Micro$oft
> dlls.  However, I do not see an option to build statically linked
> binaries that require no dlls.  Is this a possibility??

Not under windows.  All windows programs require a runtime library of
some sort (like "glibc" on linux).  On the windows platform, all of the
available runtime libraries are dynamic libs (dlls).  This includes:
  msvcrt.dll  (microsoft runtime)
  crt.dll     (older microsoft runtime)
  cygwin1.dll (cygwin runtime)

> 
> (-static doesn't seem to have any effect:
> man gcc:
>        -static
>               On  systems that support dynamic linking, this pre-
>               vents linking with the shared libraries.  On  other
>               systems, this option has no effect.
> )

Incorrect.  "-static" causes the linker to *prefer* static libs over
dynamic libs, but if there is only a dynamic lib then the linker goes
ahead and uses it rather than bail out and fail.  In the case of runtime
libraries, there are only dll's -- so you will always dynamically link
to one of the runtimes.

--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