tags:

views:

268

answers:

3

Let's say I have an application which I compiled under cygwin, and I want to distribute that application without having the user to install cygwin. Would it be enough to package the executable and the cygwin DLL?

A: 

Normally, yes. Be sure to install the Cygwin DLL in a public location though (Windows\System32), this DLL behaves very badly when multiple versions of it are loaded on the same machine.

Wim
[GPL Linking and Derived Works](http://en.wikipedia.org/wiki/GNU_General_Public_License#Linking_and_derived_works)
Kristopher Ives
The question didn't state anything about the author not releasing the code. Many utilities do bundle a cygwin1.dll. One such example is cntml: http://cntlm.sourceforge.net/.
brianegge
A: 

You could try to compile everything as static. That should allow you to run everything without the need of the the libs (since they are already in your binary). But this will also mean that it might not work an all platforms if cygwin would need a different or newer dll.

Sorin
+1  A: 

Does your application actually need any Cygwin provided Posix emulation? If not, you can compile it with the -mno-cygwin flag and it won't depend on cygwin at all, but will be a native Windows application. Often, you only need a real shell (bash) to configure and build your application, but you don't actually need the Posix functionality of Cygwin.

Another alternative is MSYS + MinGW, which is a light-weight fork of Cygwin. This provides a compilation environment which produces native Windows apps by default.

A third option would be to use the MinGW compilers from Cygwin itself. They should be available via the normal Cygwin package manager. Then you would configure the project for a cross-compile using the MinGW compilers.

Matthew Talbert
MSYS is not a fork of cygwin.
anon
http://www.mingw.org/history http://en.wikipedia.org/wiki/MinGW#Comparison_with_CygwinIn addition, the main guys on the MinGW mailing list often say that MinGW/MSYS is a fork of cygwin.
Matthew Talbert
MinGW is not MSYS
anon
OK, I think you're being pedantic here; nevertheless, I have edited my post to avoid the issue. Still, msys-1.0.dll would be the functional equivalent of cygwin.dll, yes? MinGW is more the compilers, and other tools which can be used outside of a bash shell, while msys provides a bash shell and (limited) posix emulation.
Matthew Talbert