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
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.
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.
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 .
Copy the folder plugins/platforms
from your Qt build to the folder containing your executable. This should get it running.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With