Qt local machine show "This application failed to start because no Qt platform plugin could be initialized"
-
I deleted Qt directly and reinstalled it, but when I run the old builded qt application or newly build an app and run, it pop the message that "This application failed to start because no Qt platform plugin could be initialized". I know that copying platforms folder to the .exe file folder may work, but how can i get rid of copying the folder every time through setting environment path or some other ways?
i have set PATH to
"D:\Qt\Qt5.12.0\5.12.0\msvc2017\bin"
"D:\Qt\Qt5.12.0\5.12.0\msvc2017\plugins"(which contains platforms folder)
“D:\Qt\Qt5.12.0\Tools\QtCreator\bin”(also contains platforms) ,but neither works. -
I deleted Qt directly and reinstalled it, but when I run the old builded qt application or newly build an app and run, it pop the message that "This application failed to start because no Qt platform plugin could be initialized". I know that copying platforms folder to the .exe file folder may work, but how can i get rid of copying the folder every time through setting environment path or some other ways?
i have set PATH to
"D:\Qt\Qt5.12.0\5.12.0\msvc2017\bin"
"D:\Qt\Qt5.12.0\5.12.0\msvc2017\plugins"(which contains platforms folder)
“D:\Qt\Qt5.12.0\Tools\QtCreator\bin”(also contains platforms) ,but neither works.@actzhy said in Qt local machine show "This application failed to start because no Qt platform plugin could be initialized":
"D:\Qt\Qt5.12.0\5.12.0\msvc2017\plugins"(which contains platforms folder)
“D:\Qt\Qt5.12.0\Tools\QtCreator\bin”(also contains platforms) ,but neither works.And that is exactly the problem with adding entries to PATH (as well as with copying DLLs to \Windows\System).
If these platform folders are incompatible, you may pick up the wrong one and your app don't start.
I'd really advice against putting Qt to PATH. In Creator, that settings are correct automatically, so your app runs. You can even open a terminal with that run environment from Creator.
Outside Creator, you should deploy your app with e.g.
windeployqt
.Regards