I have no doubt that this question has been answered countless times before, but my searches have not produced an answer yet.

I'm writing a library using LGPLv3 and I would like to copy a couple of utility files from a GPLv3 project and change the namespace. Is it sufficient to keep the GPL header with the files and credit the project? Alternatively, can you add another license file to the project and reference just those files in it? Would the same answer apply if using MIT instead of LGPLv3?

Edit: update based on comment received

The comment seems consistent with what I'm finding elsewhere, basically license library as GPLv3 or don't copy any parts of any project that is. So I have a follow up question now, because I have no problem using the same license, but I can't use it in all projects that I will create that uses my own library. I also have no problem writing the half dozen functions that I need from scratch, I'd just like to do what's right and still be able to write applications for my employer that they don't want to give away.

If I do use GPLv3 for my library can I link to it from another application that I create with it? The internet says absolutely not, and also yes in some cases.

I've tried to comprehend the descriptions about linking here https://en.wikipedia.org/wiki/GNU_General_Public_License#Linking_and_derived_works, but this honestly makes my head hurt.

  • 1
    If you're copying GPLv3 code into your library, the GPLv3 provisions apply to the whole library at this point. You might as well license the whole thing GPLv3 and save yourself having multiple sets of license files. Jun 18, 2019 at 21:35

1 Answer 1


The LGPLv3 is the GPLv3 plus an exception that allows linking with non-GPL programs. Only the copyright holder can grant this exception. You are not authorized to add this exception to a third party's GPL code. Therefore, you cannot include the GPL code into your library and also license the library as a whole under the LGPLv3.

However, the LGPL and GPL are highly compatible. Individual parts of this library may use either LGPL or GPL, but as a whole that library would be subject to only the GPL – the LGPL's extra permissions are ignored here. Your library is no longer LGPL-licensed at this point.

You are allowed to link GPL libraries with other software, under two circumstances:

  • either, this is for purely internal or private use and you do not distribute that software with the library;
  • or, the software is under a GPL-compatible license and the software as a whole (incl library) is distributed under the terms of the GPL.

(Note: There are vastly different opinions on linking as evidenced by the Wikipedia article you linked. This answer is modelled after the FSF position.)

For example, using a GPL software like Wordpress in a web server backend is usually not a problem. In contrast, you cannot use GPL-covered code in a proprietary program that you give to other people or organizations.

In your scenario, it seems that writing the necessary code yourself would be preferable over including GPL code.

  • Thanks, this answers all of my questions. I actually did end up writing everything that I needed myself last night. None of it was particularly difficult, just time consuming, hence the desire to copy and credit.
    – geoffjay
    Jun 19, 2019 at 22:12

Your Answer

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

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