This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?


	- Wes

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]