6

I'm putting much work in my program and after it's done I want to just setup a small website and sell each copy of the program but I don't want any legal issues.

Do I have to look for another library or can I "safely" link to it?

gnat
  • 21,442
  • 29
  • 112
  • 288

2 Answers2

5

The GPL is a heavily viral license. If you use GPL code in your program at all, the entire codebase has to be compatible with the GPL.

If the library in question is available as both GPL and LGPL, you can link to it dynamically (as an external DLL/SO/dylib/whatever) without being in violation of the LGPL. If not, you need to look for another library, or a different business model.

Mason Wheeler
  • 82,151
  • 24
  • 234
  • 309
3

No. You can't. That's a violation of the GPL and one can be sued for distributing software that uses the GPL'd library without making the source code of said library publicly available. The code that was freely given to the world came with the string that if you use it in a project, you have to freely give the project away. This is not the MIT or BSD open licenses, you can't take the code and lock it away under your own ownership. The people making this software did not do it to help you make a buck, they did it to help the world solve problems.

Go look for an alternative, or give it all away for free.

maple_shaft
  • 26,401
  • 11
  • 57
  • 131
Philip
  • 6,742
  • 27
  • 43
  • 3
    If there's an exception to the license, or it's LGPL, sure, but then it's not exactly the GPL. The matter is [contentious](http://en.wikipedia.org/wiki/GNU_General_Public_License#Libraries) but the FSF, the guys who made the GPL, have the view that statically linking a GPL'd library is clearly a violation. Come on Maple, that's a ludicrous use of "absolutely". – Philip May 21 '13 at 22:27
  • I stand corrected, http://www.gnu.org/philosophy/why-not-lgpl.html ... I didn't realize that the FSF interprets dynamically linked libraries as a derivative work. Reversed downvote and +1. – maple_shaft May 21 '13 at 23:03