Lion King Lion King - 1 year ago 215
C++ Question

This application failed to start because it could not find or load the Qt platform plugin "windows" error message

I have created an application by using

Qt v5.3.1
MinGW v4.8.2
windows 7 32bit

I have the following error when open my application:

I've inclusion all important files to run my application by using

Also the
folder contains:

Also I've inclusion all important files to run my application manually without use
tool, and the problem still exists.

I don't know how to solve this problem .


The the result of using
Dependency Walker

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

Answer Source

Firstly, thank everyone for contributing to the understanding of the problem and how to solve it.

Now, to solve this problem you must read this article Accurately, in order to understand first what is the problem, and then how to solve it. [Deploying a real Qt app – understanding more of Qt]

The conclusion In short :
the reason of the problem is the path of the plugins that you used in your project.
The default path to plugins that you used in your project is qt path folder, but when qt development environment not be installed on your machine, your application will not run, because the default path to plugins directed to qt path folder, and this is the problem.
We need to direct/change the plugins path to your application folder.

There are several ways to direct/change the path. I will mention the way in which I have already tried and succeeded in solving the problem

There is a static method named addLibraryPath(const QString & path), this method We will use it to direct/change the plugins path.


int main(int argc, char *argv[])
    QApplication a(argc, argv);
    Widget w;;

    return a.exec();

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

You can also change




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

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download