This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
True Static Linking
- From: Westley Weimer <weimer at EECS dot Berkeley dot EDU>
- To: cygwin at cygwin dot com
- Cc: weimer at cs dot berkeley dot edu
- Date: Tue, 16 Apr 2002 20:49:41 -0700 (PDT)
- Subject: True Static Linking
I am using gcc under cygwin and I would like to ship hello.exe to a friend
who does not have cygwin1.dll on his computer.
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs
gcc version 2.95.3-5 (cygwin special)
$ gcc hello.c -o hello.exe -static
Unfortunately, this does not work because cygwin1.dll is not present on the
target computer. You can simulate the problem as follows:
$ PATH= ./hello.exe
[ Windows Error Box:
The dynamic link library cygwin1.dll cannot be found in the
path C:\WINNT ... ]
I am willing to have "hello.exe" be fairly large, but shipping all of
cygwin1.dll (700K) is not allowed. If this were linux I would pull all of
the .o files out of cygwin1.a (or whatever) and link against a subset of
them manually. I have no idea how to do this under cygwin.
(1) Is there a "-static" switch that statically links in cygwin1.dll?
(2) If not, how else can I solve this problem?
Thanks!
- Wes
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/