为iOS编译Qt(UIKit灯塔)

sta*_*son 5 qt uikit lighthouse ios

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

我按照本文的说明操作:文章网址

  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. opensource许可证
  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

在努力解决这个问题之后,在这里和那里搜索,找不到任何有用的东西(甚至没有关于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

sta*_*son 0

当我在另一台装有 OS X 10.7.1 的 Mac 上尝试同样的操作时,这个问题神奇地不存在了

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