Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED] Finishing app
Well, this is a question i've been having for a long amount of time. I don't even know if this is the right section but here i go.
Let's say i finish my application, how do i exactly distribute it? I mean, it requires Qt libraries to run, i can re-distribute them with my application? (Using an installer, it installs the application and the Qt libraries required to run). What exact libraries should i re-distribute in the case i have to?
What if for example i look at one of the Qt examples and i adapt the code (Modifying it.) to work with my current one? Does that change on something?
Thanks and sorry for the questions.
The end-user doesn't need a full Qt installation to run Qt-based applications. Assuming you are on Windows, just distribute the Qt DLL's that your application depends on along with the EXE file. Put the DLL's and the EXE file into the same folder. If you are using MSVC you may also need to put the compiler-specific MSVCRT DLL's into that folder. That's it. In the easiest case you just package everything your application needs into a ZIP file for distribution. There also are a lot of tools that can convert such ZIP file into a "self-extracting" EXE file. For a more sophisticated "Setup" program use "NSIS":http://nsis.sourceforge.net/Main_Page or, alternatively, "Inno Setup":http://www.jrsoftware.org/isinfo.php!
If in doubt which DLL's your EXE file depends on (either directly or indirectly) use Dependency Walker:
Where are those DLLs located? I remind some people telling not to use the DLLs on the Qt installation folder.
The DLL's are located in your Qt installation folder inside the "bin" sub-folder.
You should redistribute the DLL's from the very same Qt version that you used to build your application.
For distribution, simply put the required DLL's into the same folder as the EXE file.
(Do NOT "install" the DLL's into "C:\Windows" or "C:\Windows\System32", because it causes DLL Hell!)
And again: Use Dependency Walker to figure out which DLL's your application really needs :-)
Hm, thank you. :)
I have a question. My exe is fine, it runs on another computer. My app has a gui, the black terminal is occured when I run .exe ...But I don't want to create it.Is this situation normal state?
kegon last edited by
Have you tried windeployqt.exe or macdeployqt ?
I use windows.
[quote author="hsrt" date="1396901206"]Hello,
I have a question. My exe is fine, it runs on another computer. My app has a gui, the black terminal is occured when I run .exe ...But I don't want to create it.Is this situation normal state?[/quote]
On Windows, program files can be compiled with subsystem "Windows" or "Console". Only the latter will have a console window attached. If you use Visual Studio compiler, you can control it with the /SUBSYSTEM option.
Also note that for "Console" application you must have a main() or wmain() function as the entry point of your program, but for "Windows" applications you need to have a wWinMain() function (or link in qtmain.lib) instead!
I use QT Creator. There is "main" function in my project. sorry, I don't understand clearly what I should do.
[quote author="hsrt" date="1396904788"]I use QT Creator. There is "main" function in my project. sorry, I don't understand clearly what I should do.[/quote]
thanks, it works :)