• Redistribute QT Programms
    16 replies, posted
I have made several programs in C++ with Qt4. Now I want to create a .exe file which is executable without having Qt installed. I have already tried to include the Qt dlls (QtCore4.dll, QtGui4.dll, and mingwm10.dll) with the programm in a sub-directory. [code] QApplication a(argc, argv); a.addLibraryPath("./dlls/"); [/code] Unfortunately this does not work and when I double click the *.exe file, nothing happens. Does anyone know how to build an working *.exe file?
Just taking a stab in the dark here, but would it be possible to statically link against the Qt libraries?
[QUOTE=turby;18985329]Just taking a stab in the dark here, but would it be possible to statically link against the Qt libraries?[/QUOTE] What do you mean by statically linking the program? When I add the Qt Path to the System variables, the programm works perfectly fine, but I want to run the application on other computers without installed Qt. Edit: I just googled the static linking thing and I am trying out a tutorial right now.
Just keep them in the same directory as the executable, skip the subdirectory that won't work.
I have tried static linking but this does not work properly, I most likely did it wrong. Nevertheless, putting the *.DLLs in the same directory than the *.exe works fine.
If you plan to distribute those DLLs, remember that you must distribute their source code as well, as required by the LGPL.
[QUOTE=Wyzard;19024619]If you plan to distribute those DLLs, remember that you must distribute their source code as well, as required by the LGPL.[/QUOTE] You sure? I thought it was that you just need to make any changes you do public.
Nope, you have to provide source code regardless of whether you modified it. See [url=http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html]LGPL 2.1[/url] section 4: [quote]You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.[/quote] A "portion or derivative" is a modified copy, but this paragraph applies to [i]all[/i] distribution of compiled copies of the library, original or modified.
I don't see why you would need to provide it unchanged if they can just get it on the site...
It ensures that the recipient gets the source code to the actual library you're giving them, in all cases -- even if it's an old version that's no longer easily available from other places, or a new beta version that isn't generally available yet, or whatever. It also means that the recipient doesn't have to blindly trust that your DLL is an unmodified original -- they can examine the source code and recompile it themselves to get a copy that they [i]know[/i] hasn't been tampered with. [QUOTE=high;19024752]you just need to make any changes you do public.[/QUOTE] BTW, this actually is not true. If you [i]choose[/i] to publish your changes, you have to provide source code, not just binaries. But you can make changes and keep the modified version to yourself and that's perfectly OK.
If you do not want to have to include your source code you will need to purchase a commercial license. [url]http://qt.nokia.com/downloads/downloads#commercial[/url] [url]http://qt.nokia.com/products/licensing[/url] [url]http://qt.nokia.com/products/pricing[/url]
You guys don't seem to understand how the LGPL works. As long as the original source is not statically linked, and has not been modified in any way, you are not required to distribute your code, or the library's code. Case in point: Every single SDL game ever. No SDL game distributes the library code, *nor* are they required to release their source (though many do). The commercial license is so that one can modify the Qt source code and still static link. Extremely helpful on certain paltforms where dynamic linking is not an option.
[QUOTE=Chandler;19027086]You guys don't seem to understand how the LGPL works. As long as the original source is not statically linked, and has not been modified in any way, you are not required to distribute your code, or the library's code.[/QUOTE] I do understand how the LGPL works. The original question is about how to make an EXE that works on a computer that doesn't already have Qt installed. That requires either static linking or distributing Qt DLLs, both of which require accompanying source code.
the second statement (accompanying source code) is incorrect. it clearly states in the LGPL [quote=LGPL License] 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. [/quote] So effectively, you don't need to distribute any source code when dynamically linking.
You don't need to distribute the source code of [i]your own program[/i]. You [b]do[/b] need to distribute the source code of the Qt DLLs if you bundle those with your program. That falls under section 4, not section 5. If you don't bundle Qt itself with your program, then you don't have to distribute any source at all. But what the OP wants requires bundling Qt.
[QUOTE=Chandler;19027461] So effectively, you don't need to distribute any source code when dynamically linking.[/QUOTE] Exactly. If the user already has Qt installed, and your program just links to it, you don't have to distribute the code for Qt. But what the OP wants to do is distribute the Qt libraries, so he has to distribute the code too. [editline]12:35AM[/editline] Late edit, but I would check to see what VLC and Virtualbox do with their Windows binaries. Both of them bundle Qt.
-snip-
Sorry, you need to Log In to post a reply to this thread.