Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a Qt application?

Tags:

c++

windows

qt

I have been using Qt creator to make applications using the Qt libraries. I can run these applications by just clicking the play button, but I want to learn how to make applications run just by double clicking on a .exe. So how can I do this?

like image 896
Kredns Avatar asked Nov 30 '22 12:11

Kredns


2 Answers

If you have built a 'release' version of your program, copy it and the following DLL's from qt\bin to a directory:

QtCore4.dll, QtGui4.dll and mingwm10.dll (if you are compiling with gcc and minGW).

If you are running a 'debug' build, you will need the debug versions of the Qt DLLs. They have the same name but with a 'd' at the end of the name.

There may be other Qt DLLs you will have to copy depending on Qt modules you are using in your program.

You can find out more from this page (Qt docs website) Deploying Qt Applications

like image 69
Arnold Spence Avatar answered Dec 05 '22 05:12

Arnold Spence


I'm assuming you are running windows since you mention an .exe file extension. Look in the debug and/or release subdirectories of your project to find the produced binary. You can double-click on it to run the application. However, there are several DLL's that will be required. So, make sure they are in your PATH or copy them in the same directory. Dependency Walker is useful for finding out what you need.

like image 34
Judge Maygarden Avatar answered Dec 05 '22 07:12

Judge Maygarden