Qt 5 and " Failed to load platform plugin 'windows' " error
To detect which dll are required by your executable there is an useful tool called Dependency Walker. Using this tool you'll can get a tree list of all dependencies of your executable. However the main subject of this post is related to a specific error showing up if no all dependencies are provided. If we check a standard executable generated using basic Qt features we'll have a list of dll dependencies very similar to the following:
Qt5Core.dll
Qt5Gui.dll
Qt5Widgets.dll
libGLESv2.dll
icudt51.dll
icuin51.dll
icuuc51.dll
Unfortunately if we try to run our executable the following error will show up:
Failed to load platform plugin 'windows'
Googling around it seem the cause of this error is the missing windows plugin as the message suggest. For fix this error is necessary to create a new folder called platforms in the same position where are the executable and all other dll and put inside this folder the qwindows.dll library. Now the program should run correctly but if the same message above show up again is very probably there is one additional dependency to provide. Dependency Walker tool showed us all the dependencies of the executable but in this case the missing dll is required by the qwindows.dll plugin just added and loaded by our application. Since the plugin doesn't find the required dll refuse to load and this return the error in topic that is a bit too much generic for help us. Anyway the missing dll that you need to put together with all other is the following:
libEGL.dll
Now the application should run correctly. If still doesn't run it depends from another problem that I currently don't know since never faced right now, I'm sorry... ^_^
great solution for me bro, thanks. btw, the first choice you offer ddn't work for me. even after I add QT_PLUGIN_PATH to the system environment.
ReplyDeletebut the second one did solve it.
It works. Adding libEGL.dll solved the problem. Thank you :)
ReplyDeletethank you very much :) copying libEGL.dll solved it for me !
ReplyDeleteBrilliant, Same here!
ReplyDeleteSurprising that this is required and the QT guys dont seem to mention it. Thanks for your sleuthing work!
from where i get ' qwindows.dll library'
ReplyDeleteand where should i but it pleas help me
Men i made new folder
ReplyDeletecalled him like u said
C:\Windows\System32\platforms
and i but on it qminimal.Dll and qwindows.Dll
and still same msg box help me pls
Hi
ReplyDeleteRead better the post here:
"is necessary to create a new folder called platforms in the same position where are the executable and all other dll"
this mean you have to create the "platforms" folder in the same path you installed your software (ex. c:\program files\my_software_name\platforms). You can find the qwindows.dll in your Qt installation folder under the library set you selected for develop (msvc20xx, mingw and so on). Subfolder "plugins\platforms".
oh bro ty it works and here is another msg :'(
ReplyDeletePROG HAS STOPPED WORKING
Aproplem caused the propleam to stop working corectly , pls close prog~
Sorry but if the program run mean all the required dll was found. This error come from something different that I never faced than can not help you...
ReplyDeletegood job ... thanks
ReplyDeleteThank you :)
ReplyDelete