【Qt报错】This application failed to start because it could not find or load the Qtplatform plugin

在VS中的relesse能运行,但是在relesae文件夹生成的exe运行报错:
This application failed to start because it could not find or load the Qtplatform plugin "windows’in "”
Reinstalling the application may fix this problem.

【Qt报错】This application failed to start because it could not find or load the Qtplatform plugin_第1张图片
看了很多帖子就是说用windeployqt命令窗口重新运行生成一下:

打开windeployqt,cd到项目release路径,运行如下命令

windeployqt QtWidgetsApplication1.exe

经过一番折腾发现,生成的dll都是debug模式下的,也就是其实上面的命令行并没有生成我们release所需的文件,比较坑,最终解决如下

windeployqt --release QtWidgetsApplication1.exe

你可能感兴趣的:(C++,c++,qt)