一、问题描述
应用程序中有使用QT的DataVisualization三维显示这个功能,用于开发应用程序的电脑打开三维显示正常,某些机台 也正常显示。
问题在于将同样的应用程序文件复制到其他电脑上,有些电脑Qt5Gui.dll报错(无法访问受保护的内存,这通常指示其他内存已损坏),无法显示3D图像。
二、解决办法
找到安装Qt安装目录下的文件,如下图所示,将其复制到显示异常的机台。
粘贴好该文件夹后,复制该文件夹路径,如图所示。
复制好 文件夹路径后,桌面找到计算机图标——鼠标右键——属性——高级系统设置——高级——环境变量。
打开环境变量设置后,找到Path,点击编辑。
将前面复制的文件夹路径粘贴到变量值对话框中,记住是 粘贴到最后面因为这里还有其他的系统便变量,加个分号隔开。
完成更改,重新打开3D显示可正运行。
三、总结
出现该问题的原因是缺少 QT的环境,本文章只是粗略解决该问题,具体是缺少哪个dll没有去深入研究。 目测是这几个dll,如图,发现不配置环境变量把这几个dll放到程序同级目录下也可以正常显示。