Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying Qt C++ Application from Visual Studio qwindows.dll error

Tags:

qt

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?

like image 831
Grambot Avatar asked Aug 21 '13 22:08

Grambot


2 Answers

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.

like image 95
Jens Avatar answered Oct 20 '22 19:10

Jens


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

like image 32
user2793449 Avatar answered Oct 20 '22 19:10

user2793449