Qt program cannot start due to fail to load Qt platform plugin “windows”

If you deploy your Qt program to another host, you may get this error when running the program on that computer:

This application failed to start because it could not find or load the Qt platform plugin “windows”.

It surprises you a little because you should have checked for the dependent dlls using dependency walker and copied all needed dlls to the installation directory. Why it complains about the lacking of plugin? In fact, the missing dll can only be found when you execute Profile/Start Profiling… in dependency walker. Dependency walker will run the program and catch the dlls that are dynamically loaded. You will see a new dll: …platforms/qwindows.dll appeared in the “Module” section on the GUI of dependency walker. If you do not run the profiling, dependency walker only lists the dlls that are statically linked to the program in the building time. Knowing this, what is left for you is to create a folder “platforms” in your app’s installation directory and copy the qwindows.dll in mingwxxxxx\plugins\platforms to that folder.

The solution seems easy but if you search the problem on the Internet, you will get a bunch of different answers that confuse you.  Some guy says you should copy libEGL.dll to the program’s folder(http://stackoverflow.com/questions/20495620/qt-5-1-1-application-failed-to-start-because-platform-plugin-windows-is-missi). Others say you need to change the source code of your program to add the following line:QCoreApplication::addLibraryPath(“./”); (http://stackoverflow.com/questions/21268558/application-failed-to-start-because-it-could-not-find-or-load-the-qt-platform-pl) before the QApplication object is constructed. I tried all those solutions and found they are not necessary.

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:
Posted in

Comments are closed, but trackbacks and pingbacks are open.