I have an MIT-licensed (in plans, currently it's not published) project. And I've found an implementation of the required algorithm in an LGPL-licensed project. Am I allowed to include that code in my project? And if so, how exactly do I state that code is copied from that file?


1 Answer 1


IANAL/IANYL. That said, it seems to me that yes, you may, provided you conform to the GNU LGPL's obligations.

In brief those seem to me to be

  • That you license the modified LGPL work under LGPL (or GPL3, but that would interfere with your desire to distribute the rest of the work under an MIT licence)

  • That you include copies of the GPL and the LGPL with the work

The other obligations seem automatically fulfilled by your distributing the rest of the work as source. The easiest way to handle the code and its copying seems to me to be to keep all the LGPL-derived code in separate source file(s), which clearly state at the top the original authors' and your copyrights, and that the files are licensed under LGPL.

If your code as written displays any kind of copyright notice at runtime, you must also

include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.

I note in passing that one of the main ideas of distributing something under an MIT licence is to permit later use in proprietary software. In the case of your project, such later use will be made much more difficult by the presence of LGPL'ed content (it's possible, but complying with the LGPL gets more onerous when there's no general source distribution). This makes the choice of MIT a bit perplexing; do consider, however briefly, distributing your project under GPL3 instead, as you could then relicence the LGPL-derived content under GPL3 (LGPL s2b) and the whole project would be under a single licence.

If the amount of code you're taking is too small to be independently copyrightable, you may be able simply to reuse it. I would advise getting a real legal opinion before you do that.

  • Thanks! I'll probably consider redistributing it under LGPL license because it's a library (if i'll not find a MIT-compatible implementation or not manage to write my own) Jan 7, 2018 at 10:04
  • By the way, you can see amount of code by clicking on the link. (swap() and swap_adjacent() functions) Jan 7, 2018 at 10:05
  • @Ancient It is probably more practical just to copy the whole file (implementation file, list.c) and then #include "list.h" in your own code to use it. Then you can simply say "list.h and list.c are from <someone> and are licensed under <license>." If it is LGPL, and you modify it (including taking a subset of the library), then you will also need to redistribute your modified version of the library under the same terms.
    – Brandin
    Jan 16, 2018 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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