问题:
使用vs2013调试qt项目时提示This application failed to start because it could not find or load the Qt platform plugin
问题出现场景:
安装了vs2013,qt5.7.1是拷贝的安装后的文件,通过qt-vsaddin配置qt后调试QT项目,提示This application failed to start because it could not find or load the Qt platform plugin
问题解决措施:
方法一:参考https://blog.csdn.net/shanxuezhe/article/details/93363751,亲测有效
1.打开控制台窗口
2.设置搜索路径以便系统可以搜索到 “windeployqt.exe”(设置qt的安装bin路径环境变量C:\ThirdPartyLibrary\Qt5.7.1\msvc2013\bin)
3.运行 “windeplayqt.exe D:\work\project\sample\bin\Release\sample.exe”, 所需要的QT运行库就自动拷贝到目标程序目录了。
其他:
1.以上方法也适合debug版本。
2.如果程序使用了新的QT模块,重新执行一遍即可
方法二:将C:\ThirdPartyLibrary\Qt5.7.1\msvc2013\plugins\platforms文件夹拷贝到exe所在目录中,参考https://blog.csdn.net/linxi8693/article/details/105740070或https://www.cnblogs.com/happyamyhope/p/7485716.html,亲测有效
方法三:配置用户环境变量QT_QPA_PLATFORM_PLUGIN_PATH C:\ThirdPartyLibrary\Qt5.7.1\msvc2013\plugins,参考https://blog.csdn.net/guojunxiu/article/details/79158843,配置好用户环境变量后,重启vs2013,亲测有效