Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ok, before everyone goes shouting about duplicate questions, yes, I've already seen several questions like this here. But none answer the question.

If I link against a GPLed library without modifying that library, do I need to release my source code?

According to this question, the answer is yes!

But this answer is not satisfactory to me. The answer basically says that I cannot use GPL code in any way without making my code open source.

But if the previous is true then that would indicate that no person or organization could ever release any proprietary software on Linux ever. Which must be wrong. Simply because in order for any application to do anything useful, open files, write to the console, create tcp connections, the application must be linked to libc which is GPLed.

So my question is this: If the GPL states, as all the previous answers on the site say it does, that a program which links to another GPL program must be GPL itself, how is it possible to create/release/sell any proprietary application at all which runs on Linux? Since as I described above that application must be liked to gpl code just to run on Linux.

A more practical example say I link to a shared library which is GPLed in a non-GPL application, would that force the non-GPL application to become GPLed? More specifically if I use a GPL library without modifying it, and then distribute that library as an .so or .dll, would that require my application be open source?

share|improve this question
You keep asking the same question in the hopes of a different answer. You cannot use GPL in non-GPL compatible software. Dead simple. – Andrew T Finnell Jul 31 '12 at 0:57
Does he really? Blimey. The answer is simple; why don't you get in touch with the authors of the GPL program and ask if they mind? If they say it's fine that's grand! If they object, then trying to strong-arm them with legal details is going to make you very very unpopular, no matter how "right" you feel you are. – James Jul 31 '12 at 7:56
@James: If they chose GPL, it is pretty strong statement they do mind. People who don't mind choose MIT or BSD or LGPL in the first place. It's very rare to see a library under full GPL. When you do, you can be almost certain it was intentional. – Jan Hudec Jul 31 '12 at 9:43
@Jan Maybe, depends on the app and john-charles intended use. But I just think it's odd how J-C is approaching this. Is j-c just trying to get the answer he wants? There are many questions on this site that could be resolved with a "just talk to them, for crying out loud". :-) – James Jul 31 '12 at 10:19
@JanHudec: I agree. I've argued to release some of our company's IP in the form of a GPL'ed library, since that would be essentially useless to our competitors and still very useful for our community. – MSalters Jul 31 '12 at 12:08

If you link to a GPL lib then you have created a derived work and your code must be GPL - this is different to LGPL code which specifically allows dynamic linking of differently licensed code. The system libraries including libc, are all LGPL.

There is also a special exemption for the Linux kernel headers and libgcc (the library implicitly called to by the compiler).

share|improve this answer
So your saying any commercial application which runs on Linux has to completely re-implement libc? Note that lib c includes thing which are not kernel calls such as strcpy, and other similar functions. – john-charles Jul 30 '12 at 22:27
No libc is LGPL - you are allowed to link to LGPL programs. There is also a general exemption for kernel/system calls so there is no argument abotu what is a system vs library call – Martin Beckett Jul 30 '12 at 22:28
What about a few years ago, when gpl v2 was the only license available? I know back a long time ago companies were offering software which ran on Linux even if it wasn't that common. – john-charles Jul 30 '12 at 22:30
LGPL is not a new license, it was first released in 1991. libc has always been LGPL. – FigBug Jul 30 '12 at 22:34
@john-charles - yes all common law gets tested in the courts, but there is quite a lot of case law on copyright. If I claim that my unmodified copy of a Batman DVD isn't a derived work and so I can sell as many as I want - the MPAA is unlikely to agree! The GNU copyleft uses copyright to enforce a license agreement in quite a clever way - one of the reasons it has never been tested in court is that everyone has always settled – Martin Beckett Jul 31 '12 at 17:40

In the general case, you are correct in that you can't link to a GPL library, distribute your code, and then not release your code as GPL.

However, there is the System Library Exception which is how folks link against Linux libs and still release their product under non-GPL licenses.

Another exception is when the two licenses are compatible with each other. Check out the FSF compatible license page for further reading.

Finally, the authors of the GPL'd lib can create specific exceptions, such as for non-commercial or hobbyist use.

Unfortunately, there are too many potentialities to have a hard and fast rule. Without more specifics in your question, your answer is "probably can't, but maybe you can."

share|improve this answer
The SLE also answers a question of a program being a derived work of the compiler since it contains a parser generated by the compiler – Martin Beckett Jul 31 '12 at 3:09
No, SLE allows developing GPL code using non-free toolchain and standard runtime, e.g. Visual Studio. It does not allow linking non-free application with GPL library, ever. – Jan Hudec Jul 31 '12 at 9:31
The output of a GPL program is not covered by the GPL. See – Le Comte du Merde-fou Jul 31 '12 at 10:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.