visual studio打包QT项目
最近在visual studio2017上开发了一个QT项目,在工具下正常编译运行,但是打包出来的QT项目无法正常执行。谨以此记录问题。
正常操作步骤:
1、配置好环境变量
2、将需要的动态库文件配置好
3、打开exe程序所在的目录,执行windeployqt 【program】.exe
错误一:
错误提示:【program】.exe-无法找到入口
无法定位程序输入点??0QNetworkRequest@@QEAA@XZ于动态链接库【program】.exe上
问题定位解决:最后排查是因为环境变量的引起的,在配置QT的环境变量之前配置过anaconda的环境变量。将QT的环境变量配置放在前面就行了。
错误二:
错误提示:
Debug Error!
Program: ****\Qt5Cored.dll(路径)
Module: 5.14.2
File: kernel\qguiapplication.cpp
Line: 1111
This application failed to start because it could not find or load the Qt platform plugin “windows”
in “”.
Reinstalling the application may fix this problem.
(Press Retry to debug the application)
问题定位解决:将QT环境变量下的platforms文件夹拷贝到exe相同目录下就行