Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt creator fails to open on Windows 10 "no Qt platform plugin could be initialized"

Tags:

windows

qt

I had removed Qt from my Surface pro 4 and reinstall it since it seemed unable to find QtQuick controls and othe qml related modules. After performing the install procedure, I tried to open qt creator and I got this message

This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: direct2d, minimal, offscreen, windows

like image 246
Lando1784 Avatar asked Jan 13 '19 12:01

Lando1784


People also ask

How do I fix application failed to start because no Qt platform plugin could be initialized error in Windows?

Sometimes corrupted system files can trigger various errors and issues when running your apps such as the “no Qt platform plugin could be initialized” error. So, we recommend you run an SFC scan or DISM to check system files.

How do I install Qt plugins?

Note: You can install only plugins that are supported by your Qt Creator version. To install plugins: Select Help > About Plugins > Install Plugins. In the Source dialog, enter the path to the archive or library that contains the plugin.

Where does Qt Look for platform plugins?

In Qt, when an application starts, the application's executable directory is the base directory where Qt searches for plugins. For example, on Windows, if the application is in C:\Program Files\MyApp and it has a style plugin, Qt looks in C:\Program Files\MyApp\styles .


2 Answers

Copy the folder plugins/platforms from your Qt build to the folder containing your executable. This should get it running.

like image 188
Martin Hennings Avatar answered Sep 19 '22 06:09

Martin Hennings


Check whether you have an environment variable (system-wide or user-level) QT_PLUGIN_PATH defined. If so, try to remove it (or rename for later restoration). I had one Qt program installed which added this environment variable during its installation procedure and afterwards was unable to even start QtCreator or other self-built Qt5 programs even though the 'platforms' subdirectory was present and contained the required dlls. You may have to reboot for the change to take effect.

like image 29
Martin Ellguth Avatar answered Sep 21 '22 06:09

Martin Ellguth