在 Windows 7 和 XP 中使用 QtQuick 2.0 部署 HelloWorld [英] HelloWorld Deployment with QtQuick 2.0 in Windows 7 and XP

查看:24
本文介绍了在 Windows 7 和 XP 中使用 QtQuick 2.0 部署 HelloWorld的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我几周来一直在努力正确部署我的应用程序(这是一种爱好),我只是不知道还能尝试什么.

I've been struggling to get my application deployed properly for several weeks now (it's a hobby), and I just don't know what else to try.

我通过选择 Applications -> Qt Quick 2 Application (Built-in Elements) 在 Qt Creator (2.6.1) 中启动了一个新项目.我调整了 QML,使背景为蓝色,文本为红色:

I started a new project in Qt Creator (2.6.1), by selecting Applications -> Qt Quick 2 Application (Built-in Elements). I tweaked the QML to make the background blue and text red:

import QtQuick 2.0

Rectangle {
    width: 360
    height: 360
    color: "blue" // Added!
    Text {
        text: qsTr("Hello World")
        anchors.centerIn: parent
        color: "red" // Added!
    }
    MouseArea {
        anchors.fill: parent
        onClicked: {
            Qt.quit();
        }
    }
}

我正在使用 Qt 5.0.1 和 x86 MSVC 2010 编译器.我构建了发布版本,它在 QtCreator 中运行良好.如果您需要更多编译器细节,我会发布它们.

I'm using Qt 5.0.1 and the x86 MSVC 2010 compiler. I built the Release version and it ran fine in QtCreator. If you need more compiler specifics, I'll post them.

为了部署,我在桌面上创建了一个名为 HelloWorld/ 的新文件夹,并从 H:QtQt5.0.15.0.1 复制了 everythingmsvc2010in*H:QtQt5.0.15.0.1msvc2010plugins* 和 'H:QtQt5.0.15.0.1msvc2010qml* 以及 Release HelloWorld.exe 可执行文件.

To deploy, I created a new folder on my desktop called HelloWorld/ and copied everything from H:QtQt5.0.15.0.1msvc2010in* and H:QtQt5.0.15.0.1msvc2010plugins* and 'H:QtQt5.0.15.0.1msvc2010qml* into it, along with the Release HelloWorld.exe executable.

矫枉过正?是的.但我很绝望.

Overkill? Yes. But I'm desperate.

当我在 Windows 7 64 位中运行 HelloWorld/HelloWorld.exe 时,应用程序运行良好.但是,当我将此 HelloWorld/文件夹复制到运行 Windows XP 32 位的虚拟机中时,它会显示一个大小合适的窗口,但其中没有任何内容(白色,没有文本).单击窗口中心时,窗口会正常关闭.

When I run HelloWorld/HelloWorld.exe in Windows 7 64-bit, the application runs fine. But when I copy this HelloWorld/ folder over into a virtual machine running Windows XP 32-bit, it shows a properly-sized window, but with nothing in it (white, with no text). When clicking in the center of the window, the window closes as it should.

所以我在 Dependency Walker 中加载了可执行文件,但没有任何异常(当然缺少 IESHIMS.DLL 和 WER.DLL).我运行了 Start Profile,得到了一系列红色错误:

So I loaded the executable in Dependency Walker, but nothing looked out of the ordinary (IESHIMS.DLL and WER.DLL were of course missing). I ran Start Profile, and got a slew of red errors:

GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") 从地址 0x78ABBA3B 的MSVCR100.DLL"调用并返回 NULL.错误:找不到指定的过程 (127).

GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "MSVCR100.DLL" at address 0x78ABBA3B and returned NULL. Error: The specified procedure could not be found (127).

GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsGetValue") 从地址 0x78ABBA48 的MSVCR100.DLL"调用并返回 NULL.错误:找不到指定的过程 (127).

GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsGetValue") called from "MSVCR100.DLL" at address 0x78ABBA48 and returned NULL. Error: The specified procedure could not be found (127).

GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsSetValue") 从地址 0x78ABBA55 的MSVCR100.DLL"调用并返回 NULL.错误:找不到指定的过程 (127).

GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsSetValue") called from "MSVCR100.DLL" at address 0x78ABBA55 and returned NULL. Error: The specified procedure could not be found (127).

GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsFree") 从地址 0x78ABBA62 的MSVCR100.DLL"调用并返回 NULL.错误:找不到指定的过程 (127).

GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsFree") called from "MSVCR100.DLL" at address 0x78ABBA62 and returned NULL. Error: The specified procedure could not be found (127).

LoadLibraryExW("C:documents and settingsownerdesktophelloworldplatformsqminimald.pdb", 0x00000000, DONT_RESOLVE_DLL_REFERENCES) 返回 NULL.错误:%1 不是有效的 Win32 应用程序 (193).

LoadLibraryExW("C:documents and settingsownerdesktophelloworldplatformsqminimald.pdb", 0x00000000, DONT_RESOLVE_DLL_REFERENCES) returned NULL. Error: %1 is not a valid Win32 application (193).

LoadLibraryExW("C:documents and settingsownerdesktophelloworldplatformsqwindowsd.pdb", 0x00000000, DONT_RESOLVE_DLL_REFERENCES) 返回 NULL.错误:%1 不是有效的 Win32 应用程序 (193).

LoadLibraryExW("C:documents and settingsownerdesktophelloworldplatformsqwindowsd.pdb", 0x00000000, DONT_RESOLVE_DLL_REFERENCES) returned NULL. Error: %1 is not a valid Win32 application (193).

GetProcAddress(0x7E410000 [USER32.DLL], "UpdateLayeredWindowIndirect") 从地址 0x013A8749 的QWINDOWS.DLL"调用并返回 NULL.错误:找不到指定的过程 (127).

GetProcAddress(0x7E410000 [USER32.DLL], "UpdateLayeredWindowIndirect") called from "QWINDOWS.DLL" at address 0x013A8749 and returned NULL. Error: The specified procedure could not be found (127).

GetProcAddress(0x7C9C0000 [SHELL32.DLL], "SHCreateItemFromParsingName") 从地址 0x013A8997 处的QWINDOWS.DLL"调用并返回 NULL.错误:找不到指定的过程 (127).

GetProcAddress(0x7C9C0000 [SHELL32.DLL], "SHCreateItemFromParsingName") called from "QWINDOWS.DLL" at address 0x013A8997 and returned NULL. Error: The specified procedure could not be found (127).

GetProcAddress(0x7C9C0000 [SHELL32.DLL], "SHGetStockIconInfo") 从地址 0x013A89C9 的QWINDOWS.DLL"调用并返回 NULL.错误:找不到指定的过程 (127).

GetProcAddress(0x7C9C0000 [SHELL32.DLL], "SHGetStockIconInfo") called from "QWINDOWS.DLL" at address 0x013A89C9 and returned NULL. Error: The specified procedure could not be found (127).

GetProcAddress(0x7C800000 [KERNEL32.DLL], "GetTickCount64") 从地址 0x670726A7 的QT5CORE.DLL"调用并返回 NULL.错误:找不到指定的过程 (127).

GetProcAddress(0x7C800000 [KERNEL32.DLL], "GetTickCount64") called from "QT5CORE.DLL" at address 0x670726A7 and returned NULL. Error: The specified procedure could not be found (127).

GetProcAddress(0x755C0000 [MSCTFIME.IME], "ImeGetImeMenuItems") 从地址 0x76397354 的IMM32.DLL"调用并返回 NULL.错误:找不到指定的过程 (127).

GetProcAddress(0x755C0000 [MSCTFIME.IME], "ImeGetImeMenuItems") called from "IMM32.DLL" at address 0x76397354 and returned NULL. Error: The specified procedure could not be found (127).

GetProcAddress(0x4FDD0000 [D3D9.DLL], "Direct3DCreate9Ex") 从地址 0x01487198 处的LIBEGL.DLL"调用并返回 NULL.错误:找不到指定的过程 (127).

GetProcAddress(0x4FDD0000 [D3D9.DLL], "Direct3DCreate9Ex") called from "LIBEGL.DLL" at address 0x01487198 and returned NULL. Error: The specified procedure could not be found (127).

我也尝试运行调试版本,但我只有 64 位版本的 MSVC100 dll,所以我无法将它们复制到 XP 机器(我只能运行 32 位可再发行版本).我不知道我可以使用哪些其他工具来尝试解决我的问题.

I also tried to run a debug version, but I only have the 64-bit versions of the MSVC100 dll's, so I can't copy them to the XP machine (I can only run the 32-bit redistributable). I don't know what other tools I can use to try to solve my problem.

我知道我一定是在做一些愚蠢的事情,但我真的在互联网上找不到任何可以提供帮助的东西.花这么多时间开发一个 Qt 应用程序,然后在尝试部署它时陷入困境,真是令人沮丧.

I know I must be doing something stupid, but I really can't find anything on the internet to help. It's really frustrating to spend so much time developing a Qt application, and then get stuck trying to deploy it.

我应该注意到,该程序在 Windows 7 32 位虚拟机中运行良好(在安装了 MSVC2012 可再发行组件之后).

I should note that the program runs just fine in a Windows 7 32-bit virtual machine (after MSVC2012 redistributable has been installed).

真的有兴趣运行的应用程序在 Windows XP 中运行起来非常奇怪.当我第一次运行它时,窗口大小正确,并显示了几个文本字符串.但是没有显示任何 Rectangle{} 元素.我让应用程序运行了几分钟,为自己煮了些咖啡,当我回到我的电脑时,窗口随着文本光标的节拍闪烁着随机的形状和文本!那是什么呀?!看起来一个基本的数学函数被搞砸了,所以界面的某些部分以不正确的尺寸和位置显示.我什至看到鼠标光标一眨眼就出现了真实的界面(是的,随机形状会随着鼠标光标的节拍出现和消失).

The application I'm really interested in running, runs really strangely in Windows XP. When I first run it, the window sizes properly and a couple text strings show up. But none of the Rectangle{} elements are displayed. I left the app running for a few minutes as I made myself some coffee, and when I returned to my computer, the window was blinking random shapes and text, to the beat of the text cursor! What the heck is that?! It looked like a basic math function was screwed up, so parts of the interface were being displayed at improper sizes and positions. I even saw the real interface show up for one blink of the mouse cursor (and yes, the random shapes appear and disappear to the beat of the mouse cursor).

一时兴起,我尝试使用该应用程序(单击我知道存在文本框的位置)来填充其中一个列表,并且成功了!除图形外,该应用程序运行良好.我知道 Qt 5.0 重新处理了一些 OpenGL 处理,对吗?这可能是一个错误,还是我没有安装的库?

On a whim, I tried using the application (clicking where I know a text box exists), to populate one of the lists, and it worked! The application is running completely fine, except for the graphics. I know Qt 5.0 reworked some of the OpenGL handling, right? Could this be a bug, or maybe a library I haven't installed?

推荐答案

  1. 安装Microsoft Visual C++ 2010 Redistributable Package (x86)在客户端计算机上 (windows xp).
  2. 使用发布版本,而不是调试版本,您似乎使用的是 Debug版本.
  3. 不要使用 OpenGL(大多数 XP 用户可能会注意到已更新 OpenGL版本,否则您可能不得不强制他们升级它.)
  1. Install Microsoft Visual C++ 2010 Redistributable Package (x86) on client machine (windows xp).
  2. Use release build, not debug build, You seems to be using Debug version.
  3. Don't use OpenGL(Most of XP Users may note have updated OpenGL version, otherwise‍ you may have to force them to upgrade it.)

更新使用适用于 Windows XP 的 OpenGL.用户必须安装或升级他们的 OpenGL 驱动程序.阅读本文.

Update Use OpenGL for Windows XP. User have to install or upgrade their OpenGL drivers. Read this.

这篇关于在 Windows 7 和 XP 中使用 QtQuick 2.0 部署 HelloWorld的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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