How to deploy my application using Qt-Creator?
Solution 1
You also need to deploy the MINGW runtime dll (mingwm10.dll
). This file is located in your Qt\2009.5\mingw\bin
directory.
Also pay attention to whether your application is compiled in debug mode or release mode. I just made the test with an hello world type application and Qt Creator. In the debug
folders, I copied libgcc_s_dw2-1.dll
, mingwm10.dll
, QtCored4.dll
and QtGuid4.dll
and it works.
Pay attention to the d
in dll names, which stands for debug: QtCore
d
4.dll
.
See Qt 4.6: Deploying an Application in Windows. For Qt 5, check this page.
Solution 2
If you don't want to have dependencies with qt/mingw dlls you should compile qt statically as explain here: http://qt.nokia.com/doc/4.6/deployment-windows.html#static-linking.
Solution 3
You may also use static linking, just add this line into the .pro
file:
QMAKE_LFLAGS += -static-libgcc
I found the solution here and successfully tested on WinXP with QT creator 2.2.0
Solution 4
Try running dependency walker on it (http://dependencywalker.com/) to see which dlls are missing?
Generally, you won't need to move those Qt libraries into your local folder since the Qt installation should've added those libraries into your path.
One possibility is that you built debug, and the Qt debug dlls are named differently
Related videos on Youtube
Brian
Updated on August 02, 2020Comments
-
Brian almost 4 years
I'm trying to deploy my simple Qt project like a hello world.
I build it successfully and can also execute it on Qt-Creator. However, I can't execute the binary directly in the release folder due to some shared library errors.
So I just copy some essential librarys to the release folder such as qtcore.dll and qtgui.dll, but I can't still execute it.
How can I deploy my simple Qt project? Is there an another step to deploy it?
-
Brian over 14 yearsI copied that file and libgcc_s_dw2-1.dll, but the following error message is occurred. The start point of the procedude is not found in the QtCore4.dll. This error message may be not exactly because it's translated into English by me
-
Gregory Pakosz over 14 years@brian > which version Qt are you using, is this the LGPL version? did you pay attention to the debug and release versions of the Qt libraries?
-
Brian over 14 yearsThanks. I resolved this problem. It failed because I used qtcore.dll and qtgui.dll located in Qt\2009.5\bin directory. When I used those files located in Qt\2009.5\qt\bin directory, it works well.
-
Gregory Pakosz over 14 yearsCool! I'm glad you sorted this out. Qt is a nifty toolkit
-
drowe almost 14 yearsThis assumes you have the license to do so. Static linking requires the commercial license.
-
Sebastian Dusza about 13 years@Drowe: You don't have to buy comercial license, You just have to release source code under LGPL/GPL licence.
-
drowe about 13 years@Seba - correct, good point. A (possibly) incorrect assumption on my part.
-
Alexander Nassian about 11 years@Seba: Also wrong. You do not have to release your code under LGPL/GPL. If you choose Qt as LGPL, you will have to release your code as in LGPL mentioned, as object files to enable users to link your application against a different Qt version. You do not have to release any source code.
-
Jacob Schoen almost 11 years@GregoryPakosz The link no longer works, it just redirects to qt.digia.com now. Was not sure what it was supposed to point to or I would have edited it.
-
Angry 84 almost 10 yearsThis is a bad idea... Never junk up windows and never use this method when deploying an application.. Take the time to see what required files are needed and deploy them with your application. While old question/answer.. Best to advise people this is NOT a good idea
-
Angry 84 almost 10 yearsUp vote for pointing out the "d" on debug files, as you do not want to deploy a debug version with 500mb+ of dll files..
-
Rajkumar R almost 8 yearsThis is a bad practice. As mentioned, look for the required dlls and add them accordingly during deployment.