编译iOS的Qt(UIKit灯塔)

我一直在努力为iOS编译Qt,但是我一直有一些疯狂的问题,至less根据我在过去一天所读到的内容,似乎没有其他人在使用。

我遵循这篇文章的说明: 文章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-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. o许可证
  5. yes我接受协议

我得到这些错误:

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

在这之后,在这里和那里search,没有任何用处(甚至没有什么CGKeyCode或CGCharCode实际上,我决定“破解”它,只是将定义添加到pbuilder_pbx.cpp:

typedef u_int16_t CGCharCode; /* Character represented by event, if any */ typedef u_int16_t CGKeyCode; /* Virtual keycode for event */

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

typedef unsigned short u_int16_t; /* compile, god damn you!!! */

到相同的标题。

现在一切编译,但有这个链接器错误:

ld: in /System/Library/Frameworks//CoreGraphics.framework/CoreGraphics, missing required architecture x86_64 in file for architecture 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

这个问题奇迹般的不存在,当我在与OS X 10.7.1不同的Mac上尝试同样的事情

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