PDA

View Full Version : Specification on LGPL and Dynamic linking



elfkarr
6th February 2010, 14:38
I already understand that we can distribute Qt dlls with our application as long as we don't make any modifications to the code and we don't have to release the source code for our application or distribute our application with source code to Qt.

However, I can't help but wonder about one thing. Must the dlls absolutely be the original binary copies of the ones that come with the Qt sdk?

Or can we make our own binary copies and distribute them (provided that they haven't been modified) without accompanying it by any source code?

What if I wanted to reduce the size of the .dlls by changing the compile defines to exclude the components that I don't use (ex: #define QT_NO_TREEVIEW) and compile my own dlls. Would it suffice to just specify which defines I have used to compile the Qt dynamic librairies, and as such I would not have to provide any source code modifications or distribute any source code with my application?

squidge
6th February 2010, 15:27
I already understand that we can distribute Qt dlls with our application as long as we don't make any modifications to the code and we don't have to release the source code for our application or distribute our application with source code to Qt.

You CAN distribute Qt DLLs with modifications as long as those modifications are open source. If you don't make any modifications, then there's no need to make anything open source as long as your application is dynamically linked (DLLs).


However, I can't help but wonder about one thing. Must the dlls absolutely be the original binary copies of the ones that come with the Qt sdk?The GPL license seems to imply that as long as someone can recompile the library and it works with your application, thats enough. If someone recompiles and includes the treeview, it shouldn't make any difference to your application. The library will just be bigger.

However, it isn't much to include the 'configure.cache' file that gets created when your recompile Qt. Then people can generate the exact same version of the library that you distributed. Of course, if you modified the header files to include or remove other #define's, then that technically is a modification to Qt itself, and therefore you should include those modified files too.

Under Linux I wouldn't recompile the library, as Qt is typically installed globally, rather than included with the application.

elfkarr
6th February 2010, 16:43
Thanks for the clarification. It's a little how I thought (or at least wished for) it to be.

You're missing one important point though. The defines can be defined globally in the make file. They don't have to be added or changed in any headers.


################################################## ###########################
# Makefile for building: simpledommodel
# Generated by qmake (2.01a) (Qt 4.6.1) on: Sat Feb 6 08:44:32 2010
# Project: simpledommodel.pro
# Template: app
################################################## ###########################

####### Compiler, tools and options

CC = gcc
CXX = g++
DEFINES = -D QT_NO_TREEVIEW -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
...

Meaning all I will really be doing is changing the compile parameters. So going by what you said, it's fine as long as I provide the exact steps I took to compile it in a Readme.txt (and indeed, if people use the original binaries it should still work anyways).

My configure.cache contains:


-debug-and-release
-confirm-license
-plugin-sql-sqlite
-plugin-sql-odbc
-qt-libpng
-qt-libjpeg
-openssl
-opensource
-no-incredibuild-xge
-dont-process

And in my case I don't think that would change. Ahh unless I removed some of those too...

Thanks.