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

孤街醉人 提交于 2019-12-24 00:49:05

问题


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


回答1:


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.




回答2:


If you have several executable and\or you don't want to copy plugins by hand, you can create a qt.conf file with the path to the plugin directory

[Paths]
Plugins = PATH_TO_QT_DIR/plugins

You need to place the qt.conf file where the executable is.
More information at http://doc.qt.io/qt-5/qt-conf.html



来源:https://stackoverflow.com/questions/14963881/failed-to-load-platform-plugin-windows-available-platforms-are-windows-minim

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!