delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/12/27/18:53:52

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
From: "Paul Garceau" <pgarceau AT teleport DOT com>
Organization: New Dawn Productions
To: cygwin AT cygwin DOT com
Date: Wed, 27 Dec 2000 15:48:59 -0800
MIME-Version: 1.0
Subject: Re: Static version of Cygwin DLL?
Reply-to: Paul Garceau <pgarceau AT teleport DOT com>
Message-ID: <3A4A0F6B.13682.39B062@localhost>
In-reply-to: <000c01c07053$e52f4250$ab00000a@costa>
X-mailer: Pegasus Mail for Win32 (v3.12c)

Hi folks,

On 27 Dec 2000, at 20:25, the Illustrious Andre Oliveira da Costa wrote:

> Hi there,
> 
> I need to build an executable using Cygwin (gcc, ld etc.), but I
> need it not to depend on cygwin1.dll. I tried to link directly
> with /usr/lib/libcygwin.a :
> 
> gcc -static -o ../bin/test.exe ../obj/test.o  -L/usr/lib -lcygwin
> 
> but the resulting executable still requires the presence of
> cygwin1.dll on the path. I've searched the archives, but did not
> find anything closer than this:
> 
> http://www.delorie.com/archives/browse.cgi?p=cygwin/1998/02/13/01
> :17:34

	The only way to force Cygwin to not depend on cygwin1.dll is to 
set the -mno-cygwin switch in your compile line 
(eg gcc -c -ofoo.exe foo.c -mno-cygwin).

	By forcing the elimination of cygwin1.dll using -mno-cygwin, 
you can then do this:

	gcc -ofoo.exe foo.c -mno-cygwin -lcygwin

	The default paths already scan the usr/lib directory.  It is 
the usr/lib directory that has the static version of cygwin 
(libcygwin.a).

	Peace,

		Paul G.


Nothing real can be threatened.
    Nothing unreal exists.

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