I'm working on a project that I want to release under the MIT license. However, it includes a GPL'ed library. I understand this means I must release my work under GPL. Am I able to release the whole work under GPL, but also license the code I wrote under the MIT license?

This does feel against the spirit of the GPL, but will it get me into trouble?


This is covered (in the affirmative) in a GPL FAQ item:

You have a GPLed program that I'd like to link with my code to build a proprietary program. Does the fact that I link with your program mean I have to GPL my program?

Not exactly. It means you must release your program under a license compatible with the GPL (more precisely, compatible with one or more GPL versions accepted by all the rest of the code in the combination that you link). The combination itself is then available under those GPL versions.

You may license your own components under any license that is GPL-compatible, i.e., its terms are a subset of the GPL's terms. You may then distribute the combination of your permissively-licensed code and the GPL-licensed component together under the GPL.

| improve this answer | |
  • Don't forget the last sentence in the FAQ: though the OP may release their code separately under a more-permissive licence, when they release it as part of the combined work it must be under the terms of the GPL. Other than that, though, +1 from me. – MadHatter May 20 '19 at 7:22
  • 1
    @MadHatter I thought, "But surely everyone who reads this in the future will carefully read the entire FAQ text, or else already know how the GPL works, right?" Thanks for reminding me that... not that. :) (I added another sentence.) – apsillers May 20 '19 at 10:40
  • @MadHatter Releasing something under the MIT license is releasing it under the terms of the GPL. "Under the terms of the GPL" means that you can comply with the GPL term's restrictions and get the GPL term's rights, which you can do for any work released under the MIT license. This is why they say "under the terms of the GPL" rather than "under the GPL". – David Schwartz Jun 18 '19 at 21:45
  • @DavidSchwartz "Releasing something under the MIT license is releasing it under the terms of the GPL" I don't agree, but I'm not sure here is a good place to have the discussion. If you'd like to discuss it more, feel free to open a question about the distinction. – MadHatter Jun 21 '19 at 17:05
  • @MadHatter I don't have any questions about the distinction. It is not ambiguous, and I agree with the interpretation of the authors and maintainers of the license. "Under the terms of the GPL" means that if you do what the terms require you to do, you get the benefits that the terms give you. That is, you can act as if you had a GPL license and everything will be fine. – David Schwartz Jun 21 '19 at 17:22

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.