2

If I write a library that is released under the terms of the GPL v2 (or higher, at option); may that library depend on another library released under the LGPL v3 (or higher), without implicitly enforcing GPL v3. That is, I am purely linking to that library.

Reading this and this, I understand that the LGPL v3 and GPL v2 are not "compatible". But it is not clear to me, whether compatibility means only mixing of code, or whether it extends to the linking (without modifying the LGPL'ed library).

  • 3
    I find it very ironic that GPL prevents the usage of open source libraries in open source projects... – Idan Arye May 11 '14 at 20:29
3

According to the License compatibility matrix from GNU, if you link your GPLv2 (or later) software with an LGPLv3 library, the effective license for the product becomes GPLv3.

The copyleft nature of the GPL licenses means that everything your software depends on must be available under the same terms as the part that actually carries the GPL license. That includes libraries you link to (with an explicit exception for major OS components and standard libraries).
The code doesn't have to be all licensed under the GPL, but the GPL does require that you have the freedom to modify all parts of an application that contains GPL code and that you have the freedom to distribute the application with or without modifications.


What it means for a license X to be compatible with the GPL is that the license X gives you, the user, at least as much freedom as the GPL does, so that in a product that contains both GPL code and code that uses license X, the distribution of that product doesn't violate any terms and conditions of either license.

GPLv3 and GPLv2 are not compatible with each other, because GPLv3 has put additional requirements in place, which is not allowed under GPLv2. This is also the reason why a combination of GPLv2 (or later) and LGPLv3 effectively 'upgrades' the GPLv2 code to GPLv3, which is possible under the "or later" permission.

0

I don't have enough rep to comment on Bart's excellent answer, but I thought it worth mentioning that some notable open source libraries dual license under the GPL and LGPL specifically to avoid such issues.

For example, Qt is available under GPLv2, GPLv3 or LGPLv3 (or under a commercial license if you pay for it). This means you can link a GPLv2 program to Qt, even if the GPLv2 program does not grant the "or later" permission. By doing this, you would be opting to use Qt under the GPLv2 licensing terms. (You need to be careful though, as not all Qt modules are available under all licenses.)


If writing a library, you need to think carefully before releasing it under multiple licenses because your users only need to comply with one of them. This means that, if your library is GPLv2+/LGPLv3+, and someone creates a modified version and releases it under only one of those licenses, you cannot merge their changes back into your library without changing your library's license. (And you cannot change your library's license unless you get the permission from all of its contributors.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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