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?
You can use and distribute LGPL libraries on your website and use them in combination with commercial code. The only big restriction is that you must keep the library open source, including any modifications you make to it, and allow your users to obtain the source, licence and copyright information for the library.
For example, header-only libraries sometimes increase code size & compilation times. "Having a header-only library also means you don't have to worry about different platforms where the library might be used": only if you don't have to maintain the library.
In the context of the C or C++ programming languages, a library is called header-only if the full definitions of all macros, functions and classes comprising the library are visible to the compiler in a header file form.
No. The GPL says that your modified versions must carry all the freedoms stated in the GPL. Thus, anyone who receives a copy of your version from you has the right to redistribute copies (modified or not) of that version.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With