vs2017-Qt错误“This application failed to start because it could not find or load the Qt platform...“
vs2017-Qt错误“This application failed to start because it could not find or load the Qt platform plugin”
环境
vs2017+Qt5.9+qt-vsaddin-msvc2017-2.4.0
问题
使用Debug+x64编译运行没有问题,改为Release时出现了下面的错误
解决方法
exe输出目录(项目/x64/Release/)缺少了dll文件,缺少的文件依据项目不同而不同
①将Qt目录中的bin目录文件全部复制到Release文件夹
②vs2017中运行项目,再次报错,不要停止项目
③回到Release文件夹,右键空白处,撤回复制,提示有几个文件正在占用中,都点击跳过
④停止运行项目,重新生成运行,成功!
参考链接:Qt5.8.0运行显示This application failed to start because it could not find or load the Qt platform plugin