Compiling Qt for iOS (UIKit lighthouse)

拜拜、爱过 提交于 2020-01-03 14:05:23

问题


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. 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

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

回答1:


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.



来源:https://stackoverflow.com/questions/8847836/compiling-qt-for-ios-uikit-lighthouse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!