32
votes

Recently we have been migrating our QT based application on Windows from QT 4.8 to QT 5, and we have run into a issue with deployment. Note that our app has not changed, we have only built it with new QT5 framework. With some effort we got it to build with VS2010 based QT5 library; and I successfully ran the app from Qt Creator.

As we did with QT4, we have included a required set of QT libraries with the installer.

In our testing phase, when we installed our QT5 app on a clean machine; it would not start. Not only the application did not start, but it did not output any errors.

We ran the app through the dependency checker; and there were no missing library dependencies at all.

8
I have the same problem on Windows XP as well, where dependency walker reports 3 irrilevant missing libraries. I'm deploying MinGW based application.CapelliC

8 Answers

37
votes

After several days of search with no progress, we stumbled upon a QT bug:

https://bugreports.qt.io/browse/QTBUG-28766

With QT5, in addition to expected QT libraries, msvcr100.dll, and msvcp100.dll; it turns out that you have to ship your application with:

platforms/qminimal.dll
platforms/qwindows.dll

as well. Which is found in your local QT5 library install @: \Qt5.0.0\5.0.0\msvc2010\plugins\platforms I searched everywhere, and I was unable to find this info in their documentation.

15
votes

For me to run standalone "Hello World" gui application ( Qt sdk 5.0.1 mingw, Win7 x64 ). I need to add next files to program dir:

  1. platforms/qwindows.dll
  2. D3DCompiler_43.dll
  3. icudt49.dll
  4. icuin49.dll
  5. icuuc49.dll
  6. libEGL.dll
  7. libgcc_s_sjlj-1.dll
  8. libGLESv2.dll
  9. libstdc++-6.dll
  10. libwinpthread-1.dll
  11. Qt5Core.dll
  12. Qt5Gui.dll
  13. Qt5Widgets.dll

The full deployment information for windows available at qt 5.5 doc

7
votes

The better choice is use: windeployqt.exe. This tool resolves the all dependencies of your application.exe.

3
votes

Yes, well spotted. I was having the same deployment problems using qt 5.0.2.

Likewise installed platforms folder with these two dlls in the apps folder, and the deployments on vista and win7 now work.

Dependency walker does not help here as it does not notify qwindows.dll or qminimal.dll as required dlls.

The platforms dlls in my Qt installation are at \Qt\5.0.2\mingw47_32\plugins\platforms.

2
votes

Qt platform dlls are located in the "plugins" folder in "qtbase": C:\Qt\5.0.0\qtbase\plugins\platforms

2
votes

for notepad tutorial, on win7 & qt5.1.1

the deploy steps is:

* change build mode to release, not debug,
* build,
* create a output folder somewhere
    e.g. desktop/notepad/
* 
* copy file to output folder
    file list:
    * from "workspace_home/build-notepad-xxx-Release/release"
        * notepad.exe
    * from "qt_home/5.1.1/msvc2010/bin"
        * icudt51.dll
        * icuin51.dll
        * icuuc51.dll
        * libEGL.dll
        * libGLESv2.dll
        * Qt5Core.dll
        * Qt5Gui.dll
        * Qt5Widgets.dll
        * 
    * from "qt_home/5.1.1/msvc2010/plugins/platforms"
        * platforms/ (need to create this sub folder in the output folder)
            * qwindows.dll
        * 
    * 
* 
* run the .exe file, make sure it works,
* 
* ok
* 
1
votes

It seems that an empty qt.conf located in the same directory as the application is causing trouble starting a Qt5 app on Windows 7. Try to delete it.

1
votes

I used an instance of QMediaPlayer and QMediaPlaylist and my application would no longer start, giving the following error: This application failed to start because it could not find or load the Qt platform plugin "windows". Reinstalling the application may fix this problem.

After spending 4 days trying to figure out what was going on, we found out there is a hardcoded path in Qt5Core.dll to load the plugins, particularly the file wmfengine.dll. Make sure you compile Qt5Core to not have this hardcoded path (:\Qt\5.5\msvc2010).

screenshot of WinDiff

Hardcoded path in Qt5Core.dll failing the plugin wmfengine.dll to load