天天看點

解決 Qt5 報錯 This application failed to start because it could not find or load the Qt platform plugin解決 Qt5 報錯 This application failed to start because it could not find or load the Qt platform plugin

解決 Qt5 報錯 This application failed to start because it could not find or load the Qt platform plugin

QT為了簡化生成釋出版本,特别提供了工具 "windeplayqt.exe",這個工具在 "...\Qt\msvc2017_64\bin"的目錄下,通過該指令,可以解決上述錯誤。

打開控制台視窗

設定搜尋路徑以便系統可以搜尋到 "windeployqt.exe"

運作 "windeplayqt.exe D:\work\project\sample\bin\Release\sample.exe", 所需要的QT運作庫就自動拷貝到目标程式目錄了。

其他

以上方法也适合debug版本。

如果程式使用了新的QT子產品,重新執行一遍即可。

解決 Qt5 報錯 This application failed to start because it could not find or load the Qt platform plugin解決 Qt5 報錯 This application failed to start because it could not find or load the Qt platform plugin