为 iOS 编译 Qt(UIKit 灯塔) [英] Compiling Qt for iOS (UIKit lighthouse)

查看:30
本文介绍了为 iOS 编译 Qt(UIKit 灯塔)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试为 iOS 编译 Qt,但我遇到了一些其他人似乎没有遇到的疯狂问题(至少根据我在过去一天读到的内容).

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

  1. 我从 git 克隆了最新的 Qt 4.8:$ git clone git://gitorious.org/qt/qt.git
  2. 我创建了 qt-lighthouse-ios-simulator 文件夹,cd 到它.
  3. 我运行了文章中的一长串代码:$ ../qt/configure -qpa -xplatform qpa/macx-iphonesimulator-g++ -arch i386 -developer-build -release -opengl es2 -no-可访问性 -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 翻译
  4. opensource 许可
  5. 我接受协议
  1. I cloned a the latest Qt 4.8 from git: $ git clone git://gitorious.org/qt/qt.git
  2. I made the qt-lighthouse-ios-simulator folder, cd to it.
  3. 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
  4. opensource license
  5. yes I accept the agreement

我收到这些错误:

在/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:

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;/* 事件表示的字符,如果有的话 */typedef u_int16_t CGKeyCode;/* 事件的虚拟键码 */

然后另一个文件无法编译,出现同样的错误.添加到几个文件后,我最终将它们添加到qcore_mac_p.h,然后一些文件抱怨他们不知道u_int16_t是什么,所以我添加了

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;/* 编译,该死的你!!!*/

到相同的标题.

现在一切都已编译,但出现此链接器错误:

Now everything compiled but there was this linker error:

ld:在/System/Library/Frameworks//CoreGraphics.framework/CoreGraphics 中,架构 x86_64 的文件中缺少所需的架构 x86_64

这就是我被卡住的地方.有什么帮助吗?

Here's where I'm stuck. Any help?

附加信息:

  • gcc --version : i686-apple-darwin10-g++-4.2.1
  • iOS SDK:我有 4.2 和 4.3
  • OS X 版本:10.6.7
  • Xcode 版本(如果重要的话):4.0.2

推荐答案

当我在装有 OS X 10.7.1 的不同 Mac 上尝试同样的事情时,问题不知何故神奇地不存在

The problem somehow magically doesn't exist, when I tried the same thing on a different Mac with OS X 10.7.1

我不知道如何以及为什么,但现在 qmake 编译和链接.

I have no idea how and why, but now qmake compiles and links.

这篇关于为 iOS 编译 Qt(UIKit 灯塔)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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