This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Re: Static version of Cygwin DLL?
- To: cygwin at cygwin dot com
- Subject: Re: Static version of Cygwin DLL?
- From: "Paul Garceau" <pgarceau at teleport dot com>
- Date: Wed, 27 Dec 2000 15:48:59 -0800
- Organization: New Dawn Productions
- Reply-to: Paul Garceau <pgarceau at teleport dot com>
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