Qt dll部署在Windows上 [英] Qt dll deployment on windows

查看:93
本文介绍了Qt dll部署在Windows上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在部署Qt应用程序时遇到了一个奇怪的问题。我在我的Windows XP 32位盒子上创建了一个带有所有必需的dll和二进制文件的Zip,其中应用程序工作正常,



然后我在笔记本电脑上运行测试windows 7 64位,给我奇怪的结果。窗口图标回到默认窗口,我的系统托盘图标是不可见的。一切都在工作。
当我从窗口上的同一资源文件中绘制一个徽标(并且在两台机器上都工作时),资源文件应该正常加载。



然后将我的win7机器的dll(我安装的相同的安装程序)复制到我的二进制文件的目录,图标再次工作。我检查了dll的哈希,它们是一样的。



此外,我也在XP机器上尝试过这些DLL,而这次没有显示图标。



这是非常奇怪的,因为dll是从同一个软件包中安装的,并且是相同的,但不能在另一台机器上工作。



有没有什么我忽略的? p>

我正在使用QT 4.7和msvs2008安装程序加上插件。

解决方案

如果您将插件部署到应用程序目录,则必须使用目录imageformats和iconengines(不带插件/前缀)。
请参阅有关部署插件的文档



编辑:如果您使用QML,还必须将imports目录(也不带导入/前缀)的内容复制到应用程序目录。


I have got a strange problem with my deployment of an Qt application. I created a Zip with all the necessary dlls and my binary on my Windows XP 32 bit box, where the application worked just fine,

Then I tested this on my laptop running windows 7 64 bit, giving me strange results. The window icons are back to the default ones and my system tray icon is invisible. Everything else is working. As I paint a logo from the same resource file on the window (and this works on both machines) the resource file should be loading fine.

I then copied the dlls (that I installed with the same installer) from my win7 machine to the directory of my binary and the icons work again. I checked the dlls hash and they are identical.

Also I tried these dlls on my XP machine, and this time it does not show the icons.

This is quite strange because the dlls are installed from the same package and are identical, but are not working on the other machine.

Is there anything I have overlooked?

I am using QT 4.7 and the msvs2008 installer plus addin.

解决方案

If you deploy the plugins to your application directory you have to use the directories imageformats and iconengines (without the plugin/ prefix). See the Documentation about Deploying Plugins

Edit: And if you use QML, you also have to copy the content of the "imports" directory (also without the imports/ prefix) to your application directory.

这篇关于Qt dll部署在Windows上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆