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
Qt platform dlls are located in the "plugins" folder in "qtbase": C:\Qt\5.0.0\qtbase\plugins\platforms
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.
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).
Hardcoded path in Qt5Core.dll
failing the plugin wmfengine.dll
to load
The better choice is use: windeployqt.exe. This tool resolves the all dependencies of your application.exe.
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 *
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.