Qwindows.dll
-
Hi,
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:
- Qt5Core.dll
- Qt5Gui.dll
- Qt5Multimedia.dll
- Qt5Network.dll
- Qt5OpenGL.dll
- Qt5Widgets.dll
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?
Thanks
-
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...
Regards
Peter -
Hi,
Just to be sure, did you copy the dlls from the Qt folder and not Qt Creator ?
-
Ok, managed to get it working by adding this line to our code:
@QApplication::addLibraryPath("./");@
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!