I am planning to develop a commercial software using a LGPL software.

In the LGPL software that I am using some functions in a class are not fully implemented. I want to modify the LGPL code so that the class and not-implemented functions are made visible outside the dll by adding dllexport infront of class and by adding virtual keyword infront of function.

Then I plan to implement those functions in my proprietary software. I am ready to distribute the modified LGPL code but not proprietary software that implements functions in the way I want.

Does that violate LGPL terms and conditions?

  • 6
    The problem with your question being here is that you aren't trying to use the license in the spirit it was written in. We can probably answer questions about the intended meaning of licenses, but we can't get into legal details at all reliably. For that, we can only recommend a lawyer. Moreover, what you're doing depends on a legal question (what is a derived work of the LGPLed software?) that hasn't been settled in the US in case law, and I've seen differing opinions among real lawyers. (I'm not a lawyer, but I've been casually following these problems.) Feb 24, 2012 at 21:07
  • Hard to say. Read this: javalobby.org/java/forums/t15903.html - they're talking about Java, but it seems applicable to any OO language. Feb 24, 2012 at 21:16

5 Answers 5


This is a complex question, but I believe that what you propose is not allowed.

You are suggesting adding hooks into the library to make it easier for you to sub-class the library and thus, at the very least. to bypass the spirit of the LGPL.

The problem is, if you sub-class a class which is subject to the LGPL license in your own code, then your work becomes a work based on the library, rather than a work which uses the library which means that your code is a derivative work that is covered under section 2 (LGPL v2.1) rather than one covered under section 6 (LGPL v2.1). I.e. it becomes subject to the LGPL!

I think that Stephen Colebourne provides a good summary over on javalobby.

I'm not a big fan of knee-jerk talk to your lawyer suggestions, but in this case I think it would be well worth doing so if you plan to proceed with this, otherwise you might be getting a nasty letter from the Free Software Foundation legal team.

Alternatively, you could ask the FSF directly. From their contact page:

For questions about free software licensing and copyright

Please check our licensing FAQ, the license list, general copyleft information, and related pages. If questions remains, email <[email protected]>.

Incidentally, in the related question Reflection and the LGPL, gbjbaanb answers with the LGPL 3.0 perspective.

  • 4
    I like "the ask the FSF" suggestion
    – ZJR
    Feb 24, 2012 at 23:57
  • My reading was that they wanted to expose more functions in the LGPL lib. So long as the resulting lib is still LGPL and a user of the OP's software is free to replace the lib with their on build - I would be happy Feb 25, 2012 at 5:15
  • 3
    @MartinBeckett - Not quite, the questioner is trying to circumvent the LGPL by modifying the library to make it easier for him to surreptitiously modify the library in his closed source code. If he were adding his new library functionality to the LGPL directly and then using that in his own code, there would be no problem. It's the fact that he's trying to keep his own new functionality closed source yet still part of the library, that's the problem.
    – Mark Booth
    Feb 26, 2012 at 11:33
  • 6
    LGPL 3.0 states: "Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library." So this should be allowed, at least under LGPL 3.0.
    – David
    Mar 1, 2012 at 13:02
  • 3
    @David - I believe that by modifying the LGPL library to allow you to override a function which couldn't normally be over-ridden you are tacitly acknowledging that your code is sufficiently tightly coupled that it has as a 'based on' rather than a 'used by' relationship with the library, so the weak copyleft activates.
    – Mark Booth
    Mar 1, 2012 at 13:31

Standard I am not a lawyer disclaimer.

LGPL requires modifications to the library source code to be distributed to anybody that used your code. It does not require that your code, which uses the library, be open-sourced and released under the same license.

Wikipedia for a more detailed, but non-lawyer description of LGPL, including a section on class inheritance.

  • +1. To summarize: we think it does not violate LGPL (but IANAL)
    – MarkJ
    Feb 24, 2012 at 5:04
  • @MarkJ - As I explain in my answer, I'm not sure that as posed, the question is simply a matter of class inheritance.
    – Mark Booth
    Mar 1, 2012 at 14:18
  • 10
    I think people just like typing IANAL because it contains "ANAL".
    – g33kz0r
    Apr 2, 2013 at 21:25

"I want to modify the LGPL code ..." this says enough that you must release any of that modified code. Then extending whether or not extending that modified code is a derivative work is up for contention and if so it becomes subject to the LGPL.

What it appears you are trying to do is circumvent the LGPL, which in this case with these techniques you can't.

If it is a derivative work, then the program's terms must allow for "modification for the customer's own use and reverse engineering for debugging such modifications." Whether a work that uses an LGPL program is a derivative work or not is a legal issue.

But if what you are trying to do is circumvent the LGPL I would contact the FSF as recommended by Mark Booth.

  • 1
    The problem is, the LGPL allows some forms of derived works, while disallowing others. I've updated my answer to make a distinction between derived works that fall under the category of work based on the library (which required to be LGPL) and work which uses the library (which doesn't).
    – Mark Booth
    Feb 27, 2012 at 11:15
  • 1
    @MarkBooth I agree with you and others, that in this case it is work based on since they are making changes to LGPL in order to expose previously private code.
    – user7519
    Mar 1, 2012 at 14:40

My guess: (but IANAL) you should release as open source the modified library as LGPL code and then drop it in a commercial program. That would work. Effectively you'd end up having an open source fork of the library around and then you'll be selling a front end for it.

But as many others rightfully said, ask the FSF: it's an intriguing patological scenario you have there; they could be wondering as much as you do if it's applicable or not. (or at least bother about it enough as to publish a FAQ entry on the topic)



If you distribute a Java application that imports LGPL libraries, it's easy to comply with the LGPL. Your application's license needs to allow users to modify the library, and reverse engineer your code to debug these modifications. This doesn't mean you need to provide source code or any details about the internals of your application. Of course, some changes the users may make to the library may break the interface, rendering the library unable to work with your application. You don't need to worry about that—people who modify the library are responsible for making it work.

In short, there is no problem with inheritance as long as you do not change the library code itself, but even if you change it, you are required to release only the library modified code, not your application code.

  • 1
    Your answer contradicts several other answers but does not provide much to back your claims. Other answers are more detailed and do a better job of explaining their assertions. Please edit your answer to provide relevant quotes from the license or the FSF in order to back your claim.
    – user53019
    May 2, 2015 at 12:51
  • How actually my answer does not provide much to back my claims? I had put link to official GNU page that clears the confusion about LGPL and class inheritance. It is even updated to cover LGPL v3.
    – The Storm
    May 3, 2015 at 19:55
  • 1
    See also: meta.stackexchange.com/questions/225370/…
    – user53019
    May 4, 2015 at 0:37

Your Answer

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