When debugging, Failed to load platform plugin "windows"
There are many posts with the same title in the forum, but it seemd that all these posts are all talking about deployment, but I'm debuging.
I'm using VisualStudio2010 on windows xp, with vs-addin 1.2.0. Normally I can run a Qt program by "Debug", without copy any Qt dlls to the program's directory.
Now the things suddenly go wrong. When I "Debug" a program, it fails and prompts: Failed to load platform plugin "windows". I know this error, one will need a 'platforms' folder (including several dlls in it) in the program's directory when deploying the program. But I'm not deploying, I'm debugging....:(
It suddenly became this. I just deleted and added some Qt versions in the 'Qt5' menu. Re-installing vs-addin does not help.
Not all my Qt versions encountered this problem, only some versions have the problem.
(If I set the environment variable QT_QPA_PLATFORM_PLUGIN_PATH, the problem would temporarily be avoided. But I have several Qt versions: some programs use this version, some other use that version. So I think these QTxxxx environment variables should be set before I start debugging a certain program, corresponding to the Qt version the certain program is using. They shouldn't be set manually.)
Anyone has good ideas?
Add -platformpluginpath $(QTDIR)\plugins\platforms\ to the Command Arguments would avoid this problem also. But I don't think it's the correct way.
Add -platformpluginpath $(QTDIR)\plugins\platforms\ to the Command Arguments would lead to other problems.
I think it's some problem of vs-addin, because I copy the troubled Qt version to another machine then it works well there.
Has anyone encountered the same problem?