Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make .exe file in Qt Creator

Tags:

c++

qt-creator

I was working on Qt Creator compiler to make a simple text editor. I did that but now want to make an .exe file of that project, but I don't know how to make an .exe file in Qt Creator compiler. Can anyone help?

like image 360
Sarwan Pasha Avatar asked Nov 30 '22 00:11

Sarwan Pasha


2 Answers

There is a tool that adds the .dlls automatically on windows.

In the command prompt navigate to your qt bin directory. It should look something like this: ...\Qt\5.9.1\msvc2017_64\bin\ (I'm using visual studio).

Run windeployqt.exe in the command prompt with your project location as the argument like this:

windeployqt.exe C:\project_folder\my_project.exe

Now my_project.exe will have the .dlls in the same directory and will execute.

like image 103
Andrew T Avatar answered Dec 20 '22 09:12

Andrew T


The executable is generated by the compiler when you build your application. To know where the executable is stored, look into

Projects (CTRL+5) -> Build settings -> General -> Build directory

This is where Qt creator will put the .exe it generates if you have shadow build enabled. If shadow build is disabled, the executable will be stored inside the project folder itself.

like image 39
zeFrenchy Avatar answered Dec 20 '22 09:12

zeFrenchy