PDA

View Full Version : c++ templates , inline functions and Qt GNU LGPL v. 2.1



elizabeth.h1
18th August 2009, 08:50
Hello again

Does Qt GNU LGPL v. 2.1 adds exceptions to using templates and inline functions ? Cause templates and inline functions are expanded inside the application code that uses the qt library. Without such exceptions I can know see the answer to the question why to buy the commercial license . Please tell me that such exception exists , although I doubt. :)

Also is Qt library using templates and inline functions a lot through the library code, and which parts are those ? I know that is using templates for the container classes.

Thanks

nish
18th August 2009, 09:52
inline/templates/inheritance all are allowed in LGPL.. dont worry

elizabeth.h1
18th August 2009, 10:00
This is citation from
http://lab.obsethryl.eu/content/lgpl-21-qt-45-and-c-templates

"The LGPL requires that users be able to replace the LGPL code with a modified version; this is trivial if the library in question is a C shared library. But there's no way to make that work with C++, where much of the library consists of inline functions and templates, which are expanded inside the code that uses the library. So to allow people to replace the library code, someone using the library would have to distribute their own source, rendering the LGPL equivalent to the GPL."

It also says that :

"LGPLv3 fixes this oversight taking the template effect into account, but an unmodified LGPLv2.1 does not "

and we know that QT is released under LGPLv2.1 ,not LGPLv3.

nish
18th August 2009, 10:29
they also have a file called nokia-lgpl-execption in the source tree take a look at that..

elizabeth.h1
18th August 2009, 10:36
Thank you :)
that answers my question