Reputation: 39
I have an application built with Qt 5.5, deployed and running on x86 Windows 7 with dynamic linking. When I try to launch it on that particular computer, I get the following error:
This application failed to start because it could not find or load the Qt platform plugin "windows".
Available platform plugins are: minimal, offscreen, windows, windows.
Reinstalling the application may fix the problem.
The "windows" plugin is indeed repeated twice in the list.
Though I have the libraries set up properly, such that they run without an issue on my main computer, here, the platforms
directory doesn't seem to be found.
File list:
MyProject\platforms\qwindows.dll
MyProject\Qt5Core.dll
MyProject\Qt5Cored.dll
MyProject\Qt5Gui.dll
MyProject\Qt5Guid.dll
MyProject\Qt5Widgets.dll
MyProject\Qt5Widgetsd.dll
MyProject\MyProject.exe
Many similar questions can be found about this error, but I have tried all the answers I have found about it (including changing file and folder names, adding various extra Qt libraries to the directory, etc.) without success. I have built the application again while making sure that all components have the right architecture, again without success.
Other than static linking, how can I make it run?
Upvotes: 0
Views: 3591
Reputation: 1188
Open Cmd and write this for qtquick deployment (remove --qmldir
for non qtquick):
windeployqt --qmldir <path-to-app-qml-files> <path-to-app-binary>
For example:
windeployqt --qmldir C:\Users\Administrator\Documents\Dyn
amicView C:\Users\Administrator\Documents\build-DynamicView-vc-Release\release
Write windeployqt
for more details.
Upvotes: 0
Reputation: 15365
Setting the QT_QPA_PLATFORM_PLUGIN_PATH
environment variable worked for me.
This solution was also mentioned here and here.
Upvotes: 0
Reputation:
Try to use windeployqt. It'll try to autocollect all needed libraries.
Upvotes: 0
Reputation: 2832
You need to put the folder 'platforms' from the \$QTDIR\$version\$complier\plugins\ (which must contains the files qwindows.dll and qminimal.dll) near your .exe file.
Usual list of dlls for Qt 5 on Windows:
Upvotes: 2