Qt运行时报错:
This application failed to start because it could not find or load the Qt platform plugin "windows"
Reinstalling the application may fix this problem.
解决办法:
QT为了简化生成发布版本,特别提供了工具 "windeployqt.exe",这个工具在 "...\Qt5.8.0\5.8\msvc2015_64\bin"的目录下,通过该命令,可以解决上述错误。
- 打开控制台窗口
- 设置搜索路径以便系统可以搜索到 "windeployqt.exe"
- 在windeployqt.exe目录下,运行 "windeployqt.exe D:\work\project\sample\bin\Release\sample.exe", 所需要的QT运行库就自动拷贝到目标程序目录了。
- 如果运行报错,重新输入为:./windeployqt.exe D:\work\project\release\test.exe
以上方法也适用于debug版本。