Could not find or load the Qt platform plugin "windows"
-
Dear all,
Even after running the windeployqt.exe (also tried with the --release flag), I got the following error:
The application failed to start because it could not find or load the Qt platform plugin "windows" in "". Available platform plugins are: windows. I have the qwindows.dll in the platforms subfolder which is a common cause. I also looked at all the related Stackoverflow answers but none of them solved my problem. The dependency walker shows several errors. What do you recommend? I use Visual Studio 2013 with release build.
-
Hi,
What does dependency walker show ?
Do you have only one version of Qt installed ?
-
@SGaist said in Could not find or load the Qt platform plugin "windows":
Hi,
What does dependency walker show ?
Do you have only one version of Qt installed ?
I have only one version of Qt installed.
The dependency walker shows in red in the tree view the following items:- QT5CORE.dll
- MSVCP120.dll (shortcut icon)
- MSVCR120.dll (shortcut icon)
- QT5WIDGETS.dll
- QT5GUI.dll
- QT5CORE.DLL (shortcut icon)
- MSVCP120.dll (shortcut icon)
- MSVCR120.dll (shortcut icon)
- QT5CORE.DLL (shortcut icon)
- MSVCP120.dll (shortcut icon)
- MSVCR120.dll (shortcut icon)
- QT5GUI.dll
In the bottom it shows:
Error: At least one required implicit or forwarded dependency was not found. Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module. Error: Modules with different CPU types were found. Warning: At least one delay-load dependency module was not found. Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
Here is a screenshot: http://imgur.com/QVPlTx5
- QT5CORE.dll
-
You should add the MSVC*120.dll alongside your application.
-
@hskoglund said in Could not find or load the Qt platform plugin "windows":
Try creating a plugins subfolder next to your .exe file, and copy the platforms subfolder into that (so you get the same directory structure as in Qt's MSVC installation, normally C:\Qt\5.7\msvc2013\plugins).
I tried it but in vain.
-
@hskoglund said in Could not find or load the Qt platform plugin "windows":
Hmm, is your app a Widgets app? In your main.cpp, you're not doing anything fancy before
QApplication a(argc, argv);
?QApplication a(argc, argv);
is my first line. And the app is a Widgets app. But I am pretty sure that the problem is with the two VS runtime dll-s as Dependency Walker refers to them everywhere. -
@Zoltan said in Could not find or load the Qt platform plugin "windows":
@hskoglund said in Could not find or load the Qt platform plugin "windows":
Hmm, is your app a Widgets app? In your main.cpp, you're not doing anything fancy before
QApplication a(argc, argv);
?QApplication a(argc, argv);
is my first line. And the app is a Widgets app. But I am pretty sure that the problem is with the two VS runtime dll-s as Dependency Walker refers to them everywhere.One additional info: as you can see in the linked screenshot, Dependency Walker says: "Modules with different CPU types were found". The GUI part is compiled as x86, while the VS part as x64. So I changed the kit to 32 bit VS, and the result is that now even inside QtCreator the same error occurs.
-
Well your Qt Creator works (I mean you can start it), and that is a 32-bit MSVC2013 Release build, so your 32-bit MSVC2013-kit should work.
Try creating a vanilla Widgets app from scratch, if it works launching from Qt Creator, try running windeployqt on it and see if it starts when you double-click it.
-
@Zoltan said in Could not find or load the Qt platform plugin "windows":
@hskoglund The same error unfortunately.
But in QtCreator,
qmake.exe Z.pro -spec win32-msvc2013
is written, which is strange, as I chose 64 bit VS compiler. How can I change it to 64 bit also?
-
@hskoglund said in Could not find or load the Qt platform plugin "windows":
Try exiting Qt Creator, delete your .pro.user file and open your .pro file. Then you should be able to select the kit again.
I created a vanilla project from scratch and that worked for 32 bit. Then I deleted the .pro.user file and set the build to 32 bit VS. After running the windeployqt tool, it starts outside QtCreator. I am very grateful for your advices!
-
@Zoltan
You can select a specific answer as the solution by clicking the three dots corresponding to it and selecting Mark this post as the correct answer. Incidentally this will also mark the thread as solved. You can give reputation points with the little arrows below the post (left of the three dots). -
@kshegunov I could give reputation but clicking on the three dots didn't offer me to accept an answer (see this image: http://imgur.com/mPmTemH).