VS2019 This application failed to start because no Qt platform plugin could be initialized
解决C++ This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.的问题
·
解决C++ This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.的问题
问题分析
程序依赖的库、资源未加载
解决方案
使用QT提供的工具 “windeployqt.exe”。
windeployqt.exe是Qt自带的工具,用于创建应用程序发布包。
简单来说,这个工具可以自动地将某程序依赖的库、资源拷贝到其所在目录,防止程序在其他电脑上运行报找不到库的错误。
具体步骤
我使用的qt版本为5.14.2,windeployqt.exe文件可在…\qt\5.14.2\msvc2017_64\bin路径下找到。
安利一个使用文件查找工具——Everything,功能强大且查找速度极快
使用cmd打开windeployqt.exe所在的目录,
输入:windeployqt.exe …\x64\Release\mytemp.exe
windeployqt.exe会自动将项目所需的依赖库、资源文件拷贝到所在目录
之后重新启动程序即可。
运行完成后:
更多推荐
已为社区贡献1条内容
所有评论(0)