8
votes

I've been googling for a solution to this issue and although I've found many people sharing my problem none of their solutions work for me.

I wrote a C++ application using Qt framework using Visual Studio 2010. I built and ran the application in "Release" mode from Visual Studio without issue, but when I copy that exe from the Release folder to a new destination (pretend its a new PC) it fails to run providing this error:

---------------------------
TestApplication
---------------------------
This application failed to start because it could not find or load the Qt platform plugin "windows".

Available platform plugins are: windows.

Reinstalling the application may fix this problem.

Within the executable directory I have the following file structure:
./TestApplication.exe
./libGLESv2.dll
./Qt5Core.dll
./Qt5Gui.dll
./QtWidgets.dll
./platforms/qwindows.dll
./qt.conf

All dll files were taken from the 5.0.0 build of Qt in the Qtbase folder where the libraries reside.

The qt.conf file is:

[Paths]
Plugins=.

Without it, the launch error is the same except it says "minimal" and "offscreen" are available platforms as well.

For all other people experiencing this error it seemed to be solved by creating the platforms folder and putting in the qwindows.dll. But doing that myself doesn't change any behavior.

Is there something I've done wrong? Perhaps my method of generating the .exe in the first place is wrong?

3
Have you followed all the steps in deployment?Davy Jones
use windeployQtCrippledTable

3 Answers

9
votes

If you are using libGLESv2.dll, then you must include libEGL.dll, too. You can't see that in depends.exe, don't know how the Qt developers managed to hide this. If your Qt is out of the box, then both Dlls are necessary even if you are not using OpenGL.

Also, if your Qt is out of the box, you need to include also the three ic*.dll, which contain information for Unicode handling.

2
votes

You can see which DLLs are needed by looking at which ones are invoked when running Debug (F5) in Qt Creator. =Carl

0
votes

The release is likely missing a library/plugin or the library is in the wrong directory and or from the wrong directory.

Qt intended answer: Use windeployqt.

Qt comes with platform console applications that will add all dependencies (including ones like qwindows.dll and libEGL.dll) into the folder of your deployed executable. This is the intended way to deploy your application, so you do not miss any libraries (which is the main issue with all of these answers). The application for windows is called windeployqt. There is likely a deployment console app for each OS.