我一直在嘗試爲iOS編譯Qt,但是我一直有一些瘋狂的問題,其他人似乎沒有(至少根據我在過去一天讀的內容)。編譯Qt for iOS(UIKit燈塔)
我跟着指示從這篇文章:article url
- 我從混帳克隆了一個最新的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 tools -nomake demos -nomake docs -nomake examples -nomake translations
o
pensource許可證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
後爲此苦苦掙扎,在這裏和那裏尋找,並沒有發現任何有用的東西(甚至沒有關於w帽子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的-蘋果darwin10-G ++ - 4.2.1
- iOS的SDK:我有兩個4.2和4.3
- OS X版本:10.6。 7
- 的Xcode版本(如果它的事項):4.0.2
聲音像某處在鏈接器選項中缺少'#import'和'-framework CoreGraphics'。 –
2012-01-13 14:38:36
@JakePetroules將'-framework CoreGraphics'手動添加到鏈接器行後,獲得以下結果:'ld:warning:忽略文件/System/Library/Frameworks//CoreGraphics.framework/CoreGraphics,在文件中缺少必需的體系結構x86_64和然後從之前的錯誤。 – stanson 2012-01-13 15:32:16