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.
Comments are closed, but trackbacks and pingbacks are open.