为 iOS 编译 Qt(UIKit lighthouse)
我一直在尝试为 iOS 编译 Qt,但我遇到了一些其他人似乎没有遇到的疯狂问题(至少根据我过去一天读到的内容)。
我按照本文中的说明进行操作:文章网址
- 我从 git 克隆了最新的 Qt 4.8:
$ git clone git://gitorious.org/qt/qt.git
- 我制作了
qt-lighthouse-ios-simulator
文件夹,cd 到它。 - 我运行了文章中的一长行代码:
$ ../qt/configure -qpa -xplatform qpa/macx-iphonesimulator-g++ -arch i386 -developer-build -release -opengl es2 -no-accessibility -no -qt3support -no-multimedia -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake 工具 -nomake 演示 -nomake 文档 -nomake 示例 -nomake 翻译
o
pensource 许可证- <代码>是我接受协议
我收到这些错误:
<代码>包含在文件中/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Accessibility.h:13, 来自/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIServices.h:49, 来自/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:34, 来自generators/mac/pbuilder_pbx.cpp:56: /System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h:65:错误:CGCharCode 尚未声明 /System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h:65: 错误:CGKeyCode 尚未声明
在努力解决这个问题后,到处搜索,没有发现任何有用的东西(甚至不知道 CGKeyCode 或 CGCharCode 实际上是什么,我决定“破解”它,并将定义添加到 pbuilder_pbx.cpp:
typedef u_int16_t CGCharCode; /* 事件代表的字符,如果有的话 */ typedef u_int16_t CGKeyCode; /* 事件的虚拟键码 */
然后另一个文件无法编译,并出现相同的错误。将它们添加到几个文件后,我最终将它们添加到 qcore_mac_p.h,然后一些文件抱怨它们不知道 u_int16_t 是什么,所以我添加了
typedef unsigned Short u_int16_t; /* 编译,该死的你!!! */
到同一标头。
现在一切都已编译,但存在此链接器错误:
ld: in /System/Library/Frameworks//CoreGraphics.framework/CoreGraphics,在架构 x86_64 的文件中缺少所需的架构 x86_64
这就是我陷入困境的地方。有什么帮助吗?
附加信息:
- gcc --version : i686-apple-darwin10-g++-4.2.1
- iOS SDK:我有 4.2 和 4.3
- OS X 版本:10.6.7
- Xcode 版本(如果重要):4.0.2
I've been trying to compile Qt for iOS, but I've been having some crazy problems that noone else seems to be having (at least according to what I read in the past day).
I followed the instructions from this article:article url
- I cloned a the latest Qt 4.8 from git:
$ git clone git://gitorious.org/qt/qt.git
- I made the
qt-lighthouse-ios-simulator
folder, cd to it. - I ran the long line of code from the article:
$ ../qt/configure -qpa -xplatform qpa/macx-iphonesimulator-g++ -arch i386 -developer-build -release -opengl es2 -no-accessibility -no-qt3support -no-multimedia -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations
o
pensource licenseyes
I accept the agreement
I get these errors:
In file included from /System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Accessibility.h:13,
from /System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIServices.h:49,
from /System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:34,
from generators/mac/pbuilder_pbx.cpp:56:
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h:65: error: CGCharCode has not been declared
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h:65: error: CGKeyCode has not been declared
After struggling with this, searching here and there, and finding nothing useful (even nothing about what CGKeyCode or CGCharCode actually are, I decided to "hack" it and just added the definitions to pbuilder_pbx.cpp:
typedef u_int16_t CGCharCode; /* Character represented by event, if any */
typedef u_int16_t CGKeyCode; /* Virtual keycode for event */
Then another file couldn't compile, with the same errors. After adding them to a couple of files, I eventually added them to qcore_mac_p.h, then some files complained that they didn't know what u_int16_t was, so I added
typedef unsigned short u_int16_t; /* compile, god damn you!!! */
to the same header.
Now everything compiled but there was this linker error:
ld: in /System/Library/Frameworks//CoreGraphics.framework/CoreGraphics, missing required architecture x86_64 in file for architecture x86_64
Here's where I'm stuck. Any help?
Additional information:
- gcc --version : i686-apple-darwin10-g++-4.2.1
- iOS SDK: I have both 4.2 and 4.3
- OS X version: 10.6.7
- Xcode version (if it matters): 4.0.2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题神奇地不存在,当我在另一台装有 OS X 10.7.1 的 Mac 上尝试同样的事情时,
我不知道如何以及为什么,但现在 qmake 可以编译和链接。
The problem somehow magically doesn't exist, when I tried the same thing on a different Mac with OS X 10.7.1
I have no idea how and why, but now qmake compiles and links.