Trouble deploying QT exe for Windows

Viewed 1564

Using QT creator 4.7.1 I make a new qt widgets application. I select release mode enter image description here

then I build the project.

in the release folder, my exe looks like this

enter image description here

now I open the command line and run the command

windeployqt.exe C:\Users\rober\Desktop\build-testingqtrelease-Desktop_Qt_5_11_2_MSVC2017_64bit-Release\release\testingqtrelease.exe

which results in this

enter image description here

upon attempting to run the exe I get an error message.

enter image description here

So I did a bit of research and found many sources talking about copying different dll's from mingw730_64 an other but none of these worked for me. I'm new to QT so I'm not sure if I'm making a simple mistake.

Any help would be appreciated. Thank you.

3 Answers

I suggest you to use Qt built with msvc 2015 32 to have the Qt applications working on Windows 2012 (32/64) up to now, and Windows 7 (32/64) up to now, but this is not the answer of your question.

To help you how to know which are the required dlls please use the application windeployqt in the bin subfolder of Qt framework. Passing as argument your exe, the utility will copy the required dlls and plugins in your exe subfolder. After please have a look ad the qt.conf file. This is a file used by Qt application to know where the plugins are stored and other stuffs.

Please try to download this https://github.com/denisgottardello/BackupTo and have a look at the qt.conf file, resource file and .pro file.

Ok, i solved it, apparently the command windeployqt.exe C:\Users\rober\Desktop\build-testingqtrelease-Desktop_Qt_5_11_2_MSVC2017_64bit-Release\release\testingqtrelease.exe didn't work due to the version incompatibility between the qt build version and the windeployqt.exe

to find your right version check your build settings : enter image description here

and navigate to the qt version, and find "windeployqt.exe"

mine was located here: F:\QT\5.12.0\msvc2017_64\bin

now, simply drag the qt, compiled exe onto the "windeployqt.exe" and it should download the appropriate dll's

Related