PDA

View Full Version : Cound not find or load qt platform plugin windows... No working solution yet !



bouchebeu
9th October 2013, 11:44
Hello everyone;

First of all, I tried all the solution foudn in this forum and internet before posting.

My dev platform: Win 7 Pro - 64bits / Qt5.1.1 / msvc2012
My deployement platform: Win 7 Pro - 64bits / Touch screen

When deploying on the production environment, and including all dlls and platform folder
(QT5Core.dll,..., qwt.dll, msvcp110.dll, msvcr110.dll, icu*.dll, libEGL.dll, libGLEv2.dll in the same folder as the executable)
(platforms/qwindows.dll, platforms/qminimal.dll)

But when launching, I get the error


This application failed to start because it could not find or lload the Qt platform plugin "windows"
Reinstalling the application may fix this problem


Some things to note:

This message doesn't come in a message box, but straight in a terminal (meaning if double click the exe, a console editor opens and closes right away)
The message doesn't have a line "There are no available platforms" (like in others similar issues on the Internet)
I can launch a small Qt gui application without this error.
I can launch a small Qwt gui application without this error.



What I did is totally start over the Qt installation, 2 times:

Once with compiling myself (configure -developer-build -opensource -opengl desktop -nomake examples -nomake tests)
Once with the installer (this time without openGL)


After compiling my project and qwt with the newly installed, I still couldn't manage to make my application work on the production computer (although it works perfectly on the dev computer)
I looked at Dependency Walker, and I'm now installing a Virtual Machine to have a clean deployement environment;
I also tried to copy the entire Qt5 root folder on the deployement environment and setting the %PATH% env variable to the Qt5 lib, plugins and bin folder.


I really am out of ideas, and I thank you for having read this and trying to help me.

d_stranz
28th October 2013, 01:52
Another thing that isn't very well documented in Qt5.

There are two solutions:

1. Create a file named "qt.conf". Put this in the same directory as your executable. Put this in it:



[Paths]
Plugins=<path to where you want to install shared plugins>/plugins


Then, create a directory called "plugins" in the shared plugins location, and a subdirectory "platforms" inside that. From your Qt distribution, find this same directory, and copy the file "qwindows.dll" from that directory into your own platforms directory.

In this case, your installation looks like:


/YourAppInstallFolder
- YourApp.exe
- any needed Qt DLLs
- qt.conf

/YourSharedPluginsInstallFolder
- /plugins
- /platforms
qwindows.dll

2. You can create the /plugins/platforms directory as a sub-directory of your application install directory, and put the dll there.

In this case, your installation will look like this:


/YourAppInstallFolder
- YourApp.exe
- any needed Qt DLLs
- /plugins
-/platforms
- qwindows.dll

Hope this helps.