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

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

问题描述

我在部署 Qt 应用程序时遇到了一个奇怪的问题.我在我的 Windows XP 32 位机器上创建了一个包含所有必要 dll 和二进制文件的 Zip,该应用程序运行良好,

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,

然后我在运行 Windows 7 64 位的笔记本电脑上对此进行了测试,结果很奇怪.窗口图标恢复为默认图标,我的系统托盘图标不可见.其他一切都在工作.当我从窗口上的同一个资源文件中绘制徽标时(这适用于两台机器),资源文件应该可以正常加载.

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.

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

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.

我也在我的 XP 机器上尝试了这些 dll,但这次它没有显示图标.

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

这很奇怪,因为这些 dll 是从同一个包安装的并且完全相同,但在另一台机器上不起作用.

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?

我使用的是 QT 4.7 和 msvs2008 安装程序以及插件.

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

推荐答案

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

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

如果您使用 QML,您还必须将imports"目录的内容(也没有导入/前缀)复制到您的应用程序目录.

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.

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

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