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工具打包自己开发的程序,在自己电脑上运行正常,可是发给测试测试时,报错 “This application failed to start because it could not find or load the Qt platform plugin could be initialized, Reinstalling the application may fix this problem”,如下图:Qt5 报错 This application failed to start because it could not find or load the Qt platform plugin

环境说明

网上有多种原因会导致这种情况,这里只说自己导致这种原因和解决办法
(1)项目编译器使用了MSVC2017-32,如下图
Qt5 报错 This application failed to start because it could not find or load the Qt platform plugin
(2)使用打包工具时选择了MinGW 提供的打包工具,如下图
Qt5 报错 This application failed to start because it could not find or load the Qt platform plugin
这样打包出来的程序给别人的电脑运行时就出现了以上的错误
(3),使用MSVC的打包工具打包后给别人的电脑运行就正常
Qt5 报错 This application failed to start because it could not find or load the Qt platform plugin

说明

其他情况也会导致这种错误的产生,不是通用的解决办法