codingNightmares codingNightmares - 5 days ago 4
C++ Question

failed to load platform plugin "windows" Available platforms are: windows, minimal

Hi Im trying to execute my .exe file from the debug folder.

Now before you go telling me about all the other related articles Ive looked at them all and their solutions are not helping with my problem.

Ok first off Im using Qwt library and trying to create a set of gauges. I got a gauge working now I need to get it to execute from the .exe.

Ive tried adding the platforms folder in with my directory and adding the windowsd.dll and minimald.dll but still does not work.

Please advise on any course of action this had got me stumped.

Also one post says to create a qt.conf file and place it in the directory but I cant find out how to make a .conf file.

UPDATE
the error reads
debug error!
Program:
...build-Desktop_Qt_5_0_1_MSVC2010_32bit-Debug\debug\gauge.exe
Module:5.0.1
File: kernel\qguiapplication.cpp
Line:781

Failed to load platform plugin "windows". Available platforms are:
minimal
Windows

Answer

When deploying Qt on Windows, you have to copy over a number of the dlls from the bin folder of the Qt directory.

On my system it is:

C:\Qt\4.8.4\bin

After you copy over all the required dll's from there, like QtCore4.dll and QtGui4.dll, if you are using any additional plugins like phonon or jpeg support, you need to copy those dll's over from the plugins folder:

C:\Qt\4.8.4\plugins

For example I make a folder in the folder with my exe called imageformats and I put qjpeg4.dll in that folder.

As far as Qwt works, you probably need to do a similar process to expose those dll's to your exe, and put them in the same folder as your exe.

The dll's listed above are for the "release" build of your exe. If you are running the "debug" version, it will look for <dll_name>d.dll.

The reasoning for putting in those paths has to do with the library search order that windows uses.

Qt, Phonon and multimedia codecs: how to bundle them?

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx

http://qt-project.org/doc/qt-4.8/deployment-windows.html#creating-the-application-package

Hope that helps.

Comments