How to create executable file for a Qt Application?

build standalone qt application for windows
build standalone qt application for linux
how to deploy qt application on windows
qt static build
qt static build msvc
qt application install
qt creating installer
windeployqt download

I've been searching on the internet for some useful and clear information about this, it's annoying that such a trivial thing is so hard to do.

What I need is to create an executable file for my Qt project, in order to run it in other computers. My project runs nicely in the Qt Creator, but when I try to run the executable created in the release folder I get errors about some dll missing, and though I have put all of them in the same directory of my .exe I now got some errors about entrypoints in procedures inside the dll (QtCore4.dll).

The solution looks like to be a static linking, I've found many information about it, but none of them really helped me. Here is what I have tried so far:

  • Using the executable created in the release folder as I said above.
  • Static Linking, following this tutorial (and many others, all almost the same thing): http://doc.qt.io/qt-4.8/deployment-windows.html but I get the following error during the "configure -static": NMAKE : fatal error U1077: '"c:\Arquivos de programas\Microsoft Visual Studio 9. 0\VC\BIN\cl.EXE"' : return code '0x2' Stop. Building qmake failed, return code 2

For that I couldn't find any solution, so here I am, just trying to create an executable file for my Qt project, hope you guys can give me some light here.

How to make .exe file in Qt Creator, we have created one qt application and we want to generate .exe file for that. So please let me know how to resolve this issue. Reply Quote -1. When I try macdeployqt xxx.appto create a executable file, it will report ERROR: Could not parse otool output line: "\t@rpath/libc++abi.1.dylib (compatibility version 1.0.0, current version 1.0.0, reexport)" and ERROR: Unexpected prefix "@loader_path".This problem happen even if I just create a new project and try to create a executable file

Here is what I did and I got it to work after some time;after making sure that your program builds inside Qtcreator,go to the directory that contains your exe and double click on it.(I'm using windows and don't know if it is the same on other platforms).A window should popup telling you which .dll is missing.Go to the directory where Qt is installed and type the exact name in the search bar(top-right in Windows 7) and the dll should show up in search results.Right click and choose open file location.Copy the file where your exe is located .Double click on the exe again.If another .dll is missing repeat the same thing until none is missing.In the end your program should run. Hope this helps.

Build Standalone Qt Application for Windows, I have just learned how to make windows application using Qt. I made As it turns out, executable written in Qt requires additional files for it to  What I need is to create an executable file for my Qt project, in order to run it in other computers. My project runs nicely in the Qt Creator, but when I try to run the executable created in the release folder I get errors about some dll missing, and though I have put all of them in the same directory of my .exe I now got some errors about

So you downloaded Qt SDK and you want to link Qt libraries statically into you application, right?

First of all, if you link statically, you don't need any Qt*.dll to be present anywhere because it is built into the application. So that alone means that your application is built using dynamic linking.

From my experience, that safest way to get it all working is:

Download Qt sources, build and install them with nmake ( using Visual Studio Command Prompt from Menu Start -> Application -> Visual Studio 2008 ). Just remember that the size of the statically linked application is dependent on the size of the *.libs and these are dependent on the pre-build configuration, for example, you can minimize the size of you application by turning off some features ( this is an example config for MacOSX, just watch out for the ones specific for Windows and add proper plaftorm - see configure.exe --help for details ):

./configure -arch x86 -platform macx-g++ --universal -cocoa -debug-and-release -opensource -static -fast -no-accessibility -no-sql-sqlite -no-qt3support -no-opengl -no-openvg -qt-zlib -no-gif -no-libmng -qt-libmng -no-libtiff -qt-libjpeg -no-3dnow -sse -no-sse2 -no-openssl -no-dbus -no-phonon -no-multimedia -no-audio-backend -webkit -no-script -no-scripttools -no-declarative -nomake demos -nomake examples -no-exceptions -no-accessibility -confirm-license

Install, setup and use Visual Studio Add-In for you Qt project (here ).

Good Luck! :)

Does anyone know how to generate .exe file for Qt-creator based , When you have installed Qt Creator and the build tools (compiler, linker, etc.), open the project file in the creator and build your application. Using Microsoft Tools. To build the Qt project as a standalone executable file run qmake and nmake. After that you should execute mt.exe to embed a manifest inside the application to avoid error such as missing MSVCP90.dll when the application is started on other computers.

Do these steps:

1- Open qt command-line window.

2- Go to the directory which .exe file exists (using cd command).

3- Run "windeployqt.exe --quick ." command

4- Run your exe file and enjoy it!

This video is great

Qt Tutorial: Distributing Your Application , Hi, I have developed a application using Qt4.4 now i want to show my application to my friends but not the code for that i need to create only executable file how  Creating a Resource File. You need a resource file (.qrc) within which you embed the input text file. The input file can be any .txt file with a paragraph of text. Create a text file called input.txt and store it in the textfinder folder. To add a resource file: Select File > New File or Project > Qt > Qt Resource File > Choose.

Deployment Qt apps on Windows, But i wanted to make it self executable, like running an independant application without qt. I also found the file .exe of my application in the  Decide whether or not to use a license. If you don't want to show the EXE user a license agreement that they have to read and agree to, just click Next.If you want to use a license agreement, check the "Display a license" box, then click Browse, select a text document that contains the license agreement, and click Open.

How to Convert Qt project Into exe File ?, In Qt Creator right click on the .pro file of your project and click on Open Try to run the executable directly from the release folder, make sure it does not  If all went well, you should now be able to use the following command to launch your app: fbs run 6. Build the .exe. After the above steps, compiling your application to a stand-alone executable should be as easy as: fbs freeze. This creates the folder target/MyApp in your project directory, with the file MyApp.exe. You can copy the folder to

How to Create Executable file for my QT application, Step 2 : Creating the installer file. In the previous step we created the executable file from our python code, but we still have multiple files (the exe file + the dependencies).

Comments
  • See this related question stackoverflow.com/questions/1011197/…
  • I've found it before, but I got the error NMAKE : fatal error U1077: '"c:\Arquivos de programas\Microsoft Visual Studio 9. 0\VC\BIN\cl.EXE"' : return code '0x2' Stop. Building qmake failed, return code 2 When I try to run the configure, and I cant find an answer to that.. But thanks.
  • I dont have that directory (mingw\bin), probably cause I'm using Visual Studio? Anyway, I copy ALL the dll files from there to my .exe file and it worked. Its not the best solution but it will work for now. Thanks.
  • You can start removing the dll files one by one and checking to see if the program is still running. That way you can easily figure out which ones are needed. That's what I usually do when dealing with DLL dependencies.
  • I don't know if you configure .PRO file in VS2008, but some qt features require their own dll's. (QtSql, etc.). Most of the times you'll be fine by using just QtCore.dll and QtGui.dll. When you use advanced features like net communication, sql, webkit and the like, check the docs: you'll likely get pointers to the library used. You can also use Dependency Walker to see what DLLs your exe needs.
  • Note that static linking requires a license or your code to be open sourced.
  • @paulm Why does static linking requires license? Is this from Qt specific? (I'm new, so asking)
  • Its what the LGPL/GPL license mandates, search here on SO to find the details
  • You just made my day. It's just that easy sometimes...