Qt 5 and " Failed to load platform plugin 'windows' " error

Once finished to develop your application using the great Qt libraries the next step will be release phase. Here you need to provide in addition of the main executable all the dll libraries dependencies required by your application to run. Basically, since the application was developed using Qt, the dependencies will be only Qt dll and some few dll connected to the compiler used.



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... ^_^

Comments

Popular posts from this blog

Access GPIO from Linux user space

Android: adb push and read-only file system error

Tree in SQL database: The Nested Set Model