Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
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.) –  David Thornley Feb 24 '12 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. –  Mike Baranczak Feb 24 '12 at 21:16
add comment

migrated from stackoverflow.com Feb 24 '12 at 4:22

This question came from our site for professional and enthusiast programmers.

4 Answers

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 <licensing@gnu.org>.

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

share|improve this answer
I like "the ask the FSF" suggestion –  ZJR Feb 24 '12 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 –  Martin Beckett Feb 25 '12 at 5:15
@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 '12 at 11:33
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 '12 at 13:02
@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 '12 at 13:31
add comment

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.

share|improve this answer
+1. To summarize: we think it does not violate LGPL (but IANAL) –  MarkJ Feb 24 '12 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 '12 at 14:18
I think people just like typing IANAL because it contains "ANAL". –  g33kz0r Apr 2 '13 at 21:25
add comment

"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.

share|improve this answer
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 '12 at 11:15
@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. –  Jarrod Roberson Mar 1 '12 at 14:40
add comment

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)

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.