16

My understanding is that a program can link dynamically to an LGPL library and include its headers, possibly with modifications, without the program having to be released under the LGPL, but any modifications to the source code that goes into building the dynamic library must be released under the LGPL.

In effect, this allows people to use the library without restrictions, but they have to contribute back any changes they make to it.

I would like to release a C++ library that I wrote as FOSS, and I would like to license it in the same spirit: allow people to use it without having to release the code that uses it, but having to release any changes they make to it. However, the LGPL itself is not a good fit for me because my library is entirely header-only (it's a template library).

What license would serve this purpose?

HighCommander4
  • 50,428
  • 24
  • 122
  • 194
  • @R.MartinhoFernandes: The Boost license is permissive. All derivate works based on them can be distributed without contributing changes back to the project. – HighCommander4 Jul 09 '12 at 22:51
  • Oh, forget I said anything then :) – R. Martinho Fernandes Jul 09 '12 at 22:55
  • 1
    To those voting to close the question: please recommend an alternative StackExchange site where it would be more appropriate. – HighCommander4 Jul 09 '12 at 22:57
  • 1
    @HighCommander4: I didn't vote to close, but this might be good at http://programmers.stackexchange.com/ – Falmarri Jul 09 '12 at 23:39
  • 4
    I'm voting to close this question as off-topic because it is about licensing or legal issues, not programming or software development. [See here](http://meta.stackoverflow.com/questions/274963/questions-about-licensing/274964#274964) and [here](http://meta.stackexchange.com/questions/139804/can-licensing-questions-ever-be-on-topic) for details, and the [help] for more. – JasonMArcher Jun 10 '15 at 18:05

1 Answers1

8

Eigen is a header only C++ library released under the LGPL3 licence. There are useful information about it on their Licensing FAQ page.

Another option is the CDDL licence. It is similar to LGPL, but it is a file based licence: you can use licensed files in any way you want as long as you make no changes to them. If you do, you'll have to share (only) those changes. One of the advantages over LGPL is that you can statically link CDDL libraries without sharing anything (of course this is irrelevant in this case, since your library is header only). One of the disadvantages is that it is incompatible with GPL licence (see here under MPL licence).

See also some FAQs on CDDL.

Michael Platings
  • 3,045
  • 2
  • 25
  • 17
Claudio
  • 1,658
  • 11
  • 18
  • 7
    [Eigen switched to MPL-2.0](http://eigen.tuxfamily.org/index.php?title=News:Relicensed_to_MPL2!) which [is useful as it is GPL/LGPL compatible and file-based](http://eigen.tuxfamily.org/index.php?title=News:Relicensing_to_MPL2!), so it is more compatible than CDDL and should be preferred therefore. – hakre Aug 05 '12 at 14:14
  • That page mentions that only section 3 applies to code in headers. It says: "The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:" – Justin Meiners Jan 30 '19 at 21:46