user788171
user788171

Reputation: 17553

cygwin C++ static/portable library to avoid releasing source code?

I have some code which I can compile and run on a Windows machine using cygwin. The code is natively Linux and compiled with g++ in cygwin.

In that code, there are several libraries that I would like to redistribute without releasing the source code. Is it possible to create portable object files that can be moved to another Windows machine with cygwin installed and be able to successfully link to them?

Upvotes: 1

Views: 1072

Answers (2)

me_and
me_and

Reputation: 15634

If your code links against the Cygwin DLL (which it will do if you build it using g++ in Cygwin), your code is affected by the GPL. If you distribute the binaries then regardless of whether or not you distribute any part of Cygwin yourself you are obliged to also distribute the source code.

When you build code that links against GPL code, that linked code is also forced under the GPL. Like it or not, that's rather the point behind the GPL.

You have two options for distributing your binaries without being obliged to make the source available under the GPL:

  • Remove the dependency on Cygwin, by rewriting your code to not require the Linux-style APIs that Cygwin provides.

  • Buy a Cygwin licence from Red Hat. That will give you the right to link against a Cygwin DLL, and to distribute all the binaries, without being obligated to release your source code under the GPL.

Edit: I also refer you to my answer to a related question on the Cygwin GPL licence.

Upvotes: 1

user827992
user827992

Reputation: 1753

There is the MinGW project which is a port of the GCC suite ( and other tools ) for Windows.

Just use the MinGW package without Cygwin if you need a compiler and/or gcc under Windows.

Upvotes: 1

Related Questions