Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
We are trying to migrate our code from Qt4 to Qt5 and we are facing some deployment issues.
So far we managed to get it working in debug mode, however when we try to run the release version, we get the 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.
We are building Qt from source, not using ANGLE, and we have the following dlls in the exec folder:
We also have the platforms subdirectory in the exec folder, in which we placed the qwindows.dll.
Querying QT_QPA_PLATFORM_PLUGIN_PATH with
@qDebug() << QLatin1String(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH"));@
gives us an empty string! Is it supposed to be the case? How can I change this variable? Anything I am missing here?
peter999 last edited by
Copy "platforms" from the plugins folder of Qt to your application. This should work. I also struggled with this, documentation is not really helpful...
Normally the plugins folder with all needed plugins should be in the applications folder. But the "platforms" folder must be side by side with plugins, when "platforms" is in "plugins", it works not (for me)...
Please also copy qminimal.dll and qoffscreen.dlll to your "platforms" folder in your exec folder...
I'm no native english speaker, I hope, it is understandable...
We already tried that and it doesn't work for us.
We also tried specifying the plugin folder in a qt.conf file, with the same results...
Just to be sure, did you copy the dlls from the Qt folder and not Qt Creator ?
Yes we copied from the Qt folder, we are not using Qt Creator at the moment.
More debugging outputs here:
@qDebug() << QPlatformIntegrationFactory::keys();@
In Debug mode, it prints:
@("minimal", "offscreen", "windows") @
Release mode prints:
Any idea why this is happening?
Ok, managed to get it working by adding this line to our code:
Apparently, the release build didn't register any library path, although the debug did.
I'm interested in knowing why the library paths would be different in debug and release mode, if anybody has an explanation for that!
vezprog last edited by
Check your PATH variable in the QtCreator environment. Make sure that your Qt bin path is located in each one.