在Windows 7和XP中使用QtQuick 2.0进行HelloWorld部署 [英] HelloWorld Deployment with QtQuick 2.0 in Windows 7 and XP
问题描述
我一直在努力使我的应用程序正常部署几个星期(这是一个爱好),我只是不知道还有什么要尝试。
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.
我在Qt Creator(2.6.1)中启动了一个新项目,通过选择应用程序 - > Qt Quick 2应用程序(内置元素)。我调整了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编译器。我建立了Release版本,它在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 / code>并复制所有从
H:\Qt\Qt5.0.1\5.0.1\msvc2010\bin\ *
和 H:\Qt\Qt5.0.1\5.0.1\msvc2010\plugins\ *
和'H:\Qt\ Qt5.0.1\5.0.1\msvc2010\qml *,以及Release HelloWorld.exe可执行文件。
To deploy, I created a new folder on my desktop called HelloWorld/
and copied everything from H:\Qt\Qt5.0.1\5.0.1\msvc2010\bin\*
and H:\Qt\Qt5.0.1\5.0.1\msvc2010\plugins\*
and 'H:\Qt\Qt5.0.1\5.0.1\msvc2010\qml* into it, along with the Release HelloWorld.exe executable.
Overkill?是。但是我绝望了。
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当然丢失)。我运行了开始配置文件,并发现了一些红色错误:
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)从MSVCR100.DLL地址0x78ABBA3B并返回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).
从地址MSVCR100.DLL调用的GetProcAddress(0x7C800000 [KERNEL32.DLL],FlsGetValue) 0x78ABBA48并返回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).
从地址MSVCR100.DLL调用的GetProcAddress(0x7C800000 [KERNEL32.DLL],FlsSetValue) 0x78ABBA55并返回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).
从地址MSVCR100.DLL调用的GetProcAddress(0x7C800000 [KERNEL32.DLL],FlsFree) 0x78ABBA62并返回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 settings\owner\desktop\helloworld\platforms \qminimald.pdb,0x00000000,DONT_RESOLVE_DLL_REFERENCES)返回NULL。错误:%1不是有效的Win32应用程序(193)。
LoadLibraryExW("C:\documents and settings\owner\desktop\helloworld\platforms\qminimald.pdb", 0x00000000, DONT_RESOLVE_DLL_REFERENCES) returned NULL. Error: %1 is not a valid Win32 application (193).
LoadLibraryExW(C:\documents and settings\owner\desktop\helloworld\ platforms\qwindowsd.pdb,0x00000000,DONT_RESOLVE_DLL_REFERENCES)返回NULL。错误:%1不是有效的Win32应用程序(193)。
LoadLibraryExW("C:\documents and settings\owner\desktop\helloworld\platforms\qwindowsd.pdb", 0x00000000, DONT_RESOLVE_DLL_REFERENCES) returned NULL. Error: %1 is not a valid Win32 application (193).
从QWINDOWS.DLL调用的GetProcAddress(0x7E410000 [USER32.DLL],UpdateLayeredWindowIndirect)地址0x013A8749并返回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).
从地址QWINDOWS.DLL调用的GetProcAddress(0x7C9C0000 [SHELL32.DLL],SHCreateItemFromParsingName) 0x013A8997并返回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).
从地址QWINDOWS.DLL调用的GetProcAddress(0x7C9C0000 [SHELL32.DLL],SHGetStockIconInfo) 0x013A89C9并返回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).
从地址QT5CORE.DLL调用的GetProcAddress(0x7C800000 [KERNEL32.DLL],GetTickCount64) 0x670726A7并返回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).
从地址IMM32.DLL调用的GetProcAddress(0x755C0000 [MSCTFIME.IME],ImeGetImeMenuItems) 0x76397354并返回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).
从地址LIBEGL.DLL调用的GetProcAddress(0x4FDD0000 [D3D9.DLL],Direct3DCreate9Ex) 0x01487198并返回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?
推荐答案
- 安装< a href =http://www.microsoft.com/en-us/download/details.aspx?id=5555 =nofollow> Microsoft Visual C ++ 2010可再发行组件包(x86)
在客户端机器上(windows xp)。 - 使用发布版本,而不是调试版本,您似乎正在使用Debug
版本。 - 不要使用OpenGL(大多数XP用户可能会注意到有更新的OpenGL
版本,否则可能必须强制他们升级。)
- Install Microsoft Visual C++ 2010 Redistributable Package (x86) on client machine (windows xp).
- Use release build, not debug build, You seems to be using Debug version.
- 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驱动程序。 阅读此。
这篇关于在Windows 7和XP中使用QtQuick 2.0进行HelloWorld部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!