[Interest] [Development] When debugging an application (using visual studio), Failed to load platform plugin "windows". Available platforms are:

魏越闽 weiyuemin at 7fgame.com
Mon May 13 15:11:20 CEST 2013


Hi, 
Many thanks!
You are right, I've moved around the Qt installation.. qmake -query is very useful.

I built Qt in machine A, copied to machine B and machine C. The absolute path of Qt installation on machine C is just the same as machine A, while the path on machine B is different.. 
So I can successfully start program using visual studio on machine C while it can't find the plugin on machine B.
That's why I thought my Qt installation is not broken.

Thank you again :)
------------------------------------------------------------------
Wei Yuemin
7FGame


-----邮件原件-----
发件人: Koehne Kai [mailto:Kai.Koehne at digia.com] 
发送时间: 2013年5月13日 16:26
收件人: 魏越闽; Qt Interest (interest at qt-project.org)
主题: RE: [Development] When debugging an application (using visual studio), Failed to load platform plugin "windows". Available platforms are:



> -----Original Message-----
> From: 魏越闽 [mailto:weiyuemin at 7fgame.com]
> Sent: Monday, May 13, 2013 10:06 AM
> To: Koehne Kai; Qt Interest (interest at qt-project.org)
> Subject: Re: [Development] When debugging an application (using visual 
> studio), Failed to load platform plugin "windows". Available platforms are:
> 
> Hi,
> Very sorry for misusing the mail list. And thank you for the comments.
> 
> 1). I've checked there's no qt.conf along my .exe. I don't even know 
> what is qt.conf before.
> 
> 2). The loading of plugins fails no matter debug or release. There are 
> indeed debug versions (XXXd.dll) of the plugins in my Qt directory. In 
> fact, my .exe will be able to start if I copy all Qt dlls and plugins 
> along my .exe. But it's inconvenient to copy a bundle of dlls whenever 
> I create a small Qt project maybe for test something. It's also 
> inconvenient when I want to use another Qt version.

The locations where Qt searches for plugins is actually hardcoded in QtCore. Easiest to show it is by running 'qmake -query' and look for 'QT_INSTALL_PLUGINS'. Is the absolute path shown here the right one?

(Note that this should work even if you don't use qmake directly. It just prints the values from the QtCore library).


> I guess QtVSAddin should set QT_DEBUG_PLUGINS and some other variables 
> whenever a start a .exe through visual studio, but sometimes it doesn't.

No, QT_DEBUG_PLUGINS is just a helper that print more information about the plugin loading process. 

> I
> tried manually set some environment variables in visual studio's 
> configuration, but the 'Environment' was always be set to '
> PATH=$(QTDIR)\bin%3b$(PATH)'
> 
> Shall I file a bug about QtVSAddin ?

No, since it's unlikely it's the addins fold. I suspect that your Qt installation is somehow broken / misconfigured, or has been moved around after installation.

Regards

Kai



More information about the Interest mailing list