0

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?

Demat
  • 39
  • 2
  • 12
  • 1
    Try to use windeployqt to autocollect libraries –  Jan 22 '16 at 14:27
  • Burich: thank you, it worked; I am not sure which library was missing, but I feel silly for not thinking of using it before. If you will submit an answer with the details, I will approve it. – Demat Jan 22 '16 at 14:59
  • Possible duplicate of [How to deploy a Qt application on Windows?](http://stackoverflow.com/questions/622418/how-to-deploy-a-qt-application-on-windows) – MrEricSir Jan 22 '16 at 19:23

4 Answers4

2

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:

enter image description here

Vladimir Bershov
  • 2,701
  • 2
  • 21
  • 51
0

Try to use windeployqt. It'll try to autocollect all needed libraries.

0

Setting the QT_QPA_PLATFORM_PLUGIN_PATH environment variable worked for me.

This solution was also mentioned here and here.

Community
  • 1
  • 1
Jim G.
  • 15,141
  • 22
  • 103
  • 166
0

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.

Unheilig
  • 16,196
  • 193
  • 68
  • 98
Mahdi Khalili
  • 1,025
  • 15
  • 32