This application could not be started because it could not find or load the Qt platform plugin "windows" error message

I created an application using Qt v5.3.1 with MinGW v4.8.2 on windows 7 32bit .
When opening the application, I have the following error:

I have all the important files to run my application using the windeployqt.exe tool.

The platforms folder also contains:

I also include all the important files to launch my application manually without using the windeployqt.exe tool, and the problem still exists.

I do not know how to solve this problem.


Edit

The result of using the Dependency Walker tool.

I still don't know how to get these question mark dll files.

+5
source share
2 answers

First of all, we thank everyone for their contribution to understanding the problem and its solution.

Now, to solve this problem, you should read this article. Precisely, to first understand what the problem is, and then how to solve it. [ Deploying a Real Qt Application - Understanding More Qt ]

Conclusion In short:
The cause of the problem is the path of the plugins that you used in your project .
The default path for the plugins that you used in your project is qt path folder , but when the qt development environment is not installed on your computer, your application will not start, because by default path to plugins directed to qt path folder , and This is problem.
We need to direct / change the path of the plugins to the folder of your application.

There are several ways to directly / change the path. I mentioned how I already tried and managed to solve the problem.

There is a static addLibraryPath method (const QString and path) , we will use this method to directly / modify the plugins path .

Example:

 int main(int argc, char *argv[]) { QApplication::addLibraryPath("pluginsFolder"); QApplication a(argc, argv); Widget w; w.show(); return a.exec(); } 

pluginsFolder is a folder containing all the plugins that you used in your project.

You can also change

 QApplication::addLibraryPath("pluginsFolder"); 

For

 QApplication::addLibraryPath("."); 

This means that the plugins in the main application folder are not in a subdirectory named plugins .
And don't forget to use the windeployqt.exe tool to deploy your project.

And finally, I hope that this short explanation will be useful for those after me who will face the same problem.

+2
source

Try adding libEGL.dll, libGLESv2.dll and D3DCompiler_43.dll to the directory level using your QtApplication.exe. It is likely that qwindows.dll uses them as a dependency, and as a result you get a silent failure. You can find out if you need those if they are in your Qt-Dir / bin. Otherwise, opening qwindows.dll in Dependency Walker may help show the missing dependency.

+1
source

Source: https://habr.com/ru/post/1201244/


All Articles