Deploying Qt c++ mingw application
-
wrote on 9 Oct 2017, 09:02 last edited by
I have created a QT application using Qt creator ide according to Mingw format! when I searched the web there is no proper way to deploy it! How can I achieve this?
-
wrote on 9 Oct 2017, 09:56 last edited by
@Kushan
This link should help youhttp://doc.qt.io/qtcreator/creator-build-example-application.html
-
@Kushan
This link should help youhttp://doc.qt.io/qtcreator/creator-build-example-application.html
-
wrote on 9 Oct 2017, 10:17 last edited by yuvaram 10 Sept 2017, 10:19
@Kushan
After build a binary is created "sample.exe", by using RUN option binary can be executed.
Inorder to make Executable without depending on Qt creator. ( When it uses Qt creator, internally it links all the modules which are specified in .pro file).For making executable sample.exe needs all the Qt modules used libraries to run independently.
Use dependency walker http://www.dependencywalker.com/ which shows list of libraries used in "sample.exe".
-
By above software - list of libraries used.
-
Need to add all the libraries in .pro file.
DESTDIR = "../../"
dlls.path += $${DESTDIR}
dlls.files += $$[QT_INSTALL_BINS]/Qt5Core.dll
dlls.files += $$[QT_INSTALL_BINS]/Qt5Gui.dll
INSTALLS += dlls -
INSTALL argument need to added as command line.
Projects (within tool bar icon) > add build step (drop down option ) > make >
In "make arguments:" add "INSTALL" -
Back to EDIT option, which shows project. Qmake , rebuild and run.
This should help to run sample.exe without Qt creator.
-
-
@Kushan said in Deploying Qt c++ mingw application:
@yuvaram This is just running my app right? not making an executable :(
running an application already needs an executable to run.
The path where the exe is built is written to the console in QtCreator.Test it properly in QtCreator and once you are finished and ready for deployment, the most easiest is to copy the exe to a separate folder and run
QTDIR/bin/windeployqt
on the exe. This copies all needed dlls beside the exe. -
@Kushan
After build a binary is created "sample.exe", by using RUN option binary can be executed.
Inorder to make Executable without depending on Qt creator. ( When it uses Qt creator, internally it links all the modules which are specified in .pro file).For making executable sample.exe needs all the Qt modules used libraries to run independently.
Use dependency walker http://www.dependencywalker.com/ which shows list of libraries used in "sample.exe".
-
By above software - list of libraries used.
-
Need to add all the libraries in .pro file.
DESTDIR = "../../"
dlls.path += $${DESTDIR}
dlls.files += $$[QT_INSTALL_BINS]/Qt5Core.dll
dlls.files += $$[QT_INSTALL_BINS]/Qt5Gui.dll
INSTALLS += dlls -
INSTALL argument need to added as command line.
Projects (within tool bar icon) > add build step (drop down option ) > make >
In "make arguments:" add "INSTALL" -
Back to EDIT option, which shows project. Qmake , rebuild and run.
This should help to run sample.exe without Qt creator.
-
-
@yuvaram Thanx my release folder is empty only the debug folder has an executable do I have to use it?
Moderatorswrote on 9 Oct 2017, 11:39 last edited by raven-worx 10 Sept 2017, 11:39@Kushan
press the button above the "run" and "debug run" button. There you will see how to change between release and debug. -
@yuvaram Thanx my release folder is empty only the debug folder has an executable do I have to use it?
6/10