-1

I've tried launching a basic Qt6 Widgets application in my PC, it builds with no errors, but it throws this error in execution:

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 (from D:\Qt\6.1.3\msvc2019_64\plugins\platforms), minimal (from D:\Qt\6.1.3\msvc2019_64\plugins\platforms), offscreen (from D:\Qt\6.1.3\msvc2019_64\plugins\platforms), windows (from D:\Qt\6.1.3\msvc2019_64\plugins\platforms), direct2d, minimal, offscreen, windows.

Have any idea what could it be? I've tried setting QT_QPA_PLATFORM_PLUGIN_PATH to the right path and I have the plugins installed, but it doesn't work. I am compiling with msvc2019 in visual studio

1 Answers1

0

SOLUTION: I found a solution to this by pasting the plugin files for the right platform on D:\Qt\6.1.3\msvc2019_64\plugins\platforms on the build folder of my project.

  • I normally copy the platform plugin folder to the same folder as my executable. I do that with a CMake script. – drescherjm Dec 28 '21 at 17:14