True Static Linking
Westley Weimer
weimer@EECS.Berkeley.EDU
Tue Apr 16 21:31:00 GMT 2002
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/
More information about the Cygwin
mailing list