Xcode 配置了qpa的Qt4.8.6编译出现问题。

Xcode 配置了qpa的Qt4.8.6编译出现问题。,xcode,macos,qt,qt4,Xcode,Macos,Qt,Qt4,在MacOSX版本10.8.5上编译Qt4.8.6源代码时,我遇到以下错误 某些与平台相关的标志似乎未启用 In file included from text/qfontengine_coretext.mm:42: text/qfontengine_coretext_p.h:64: error: expected `)' before‘font’ text/qfontengine_coretext_p.h:65: error: expected `)' before‘font’ text/qf

在MacOSX版本10.8.5上编译Qt4.8.6源代码时,我遇到以下错误

某些与平台相关的标志似乎未启用

In file included from text/qfontengine_coretext.mm:42:
text/qfontengine_coretext_p.h:64: error: expected `)' before‘font’
text/qfontengine_coretext_p.h:65: error: expected `)' before‘font’
text/qfontengine_coretext_p.h:93: error: ‘CGContextRef’ has not
been declared
text/qfontengine_coretext_p.h:111: error: ‘CTFontRef’ does not 
name a type
text/qfontengine_coretext_p.h:112: error: ‘CGFontRef’ does not
name a type
text/qfontengine_coretext_p.h:114: error: ‘CGAffineTransform’ does 
not name a type
text/qfontengine_coretext_p.h:122: error: expected ‘,’ or ‘...’
before ‘&’ token
text/qfontengine_coretext_p.h:122: error: ISO C++ forbids
declaration of ‘QCFString’ with no type
text/qfontengine_coretext_p.h:123: error: expected `)' before
‘ctFontRef’
text/qfontengine_coretext_p.h:134: error: ‘CTFontRef’ does not
name a type
text/qfontengine_coretext_p.h:144: error: ‘CTFontRef’ has not been
declared
text/qfontengine_coretext_p.h:145: error: ‘CTFontRef’ does not
name a type
text/qfontengine_coretext_p.h:146: error: ISO C++ forbids
declaration of ‘QCFType’ with no type
text/qfontengine_coretext_p.h:146: error: expected ‘;’ before ‘<’
token
text/qfontengine_coretext_p.h:147: error: ‘CGAffineTransform’ does
not name a type
text/qfontengine_coretext_p.h:152: error: ‘CGAffineTransform’ does
not name a type
text/qfontengine_coretext.mm:53: error: ‘acosf’ was not declared 
in this scope
text/qfontengine_coretext.mm:53: error: ‘tanf’ was not declared in 
this scope
text/qfontengine_coretext.mm:55: error: variable or field 
‘loadAdvancesForGlyphs’ declared void
text/qfontengine_coretext.mm:55: error: ‘CTFontRef’ was not 
declared in this scope
text/qfontengine_coretext.mm:56: error: ‘CGGlyph’ was not declared    
in this scope
text/qfontengine_coretext.mm:56: error: template argument 1 is 
invalid
text/qfontengine_coretext.mm:56: error: ‘cgGlyphs’ was not 
declared in this scope
text/qfontengine_coretext.mm:57: error: expected primary-
expression before ‘*’ token
text/qfontengine_coretext.mm:57: error: ‘glyphs’ was not declared 
in this scope
text/qfontengine_coretext.mm:57: error: expected primary-
expression before ‘int’
text/qfontengine_coretext.mm:58: error: expected primary-
expression before ‘flags’
text/qfontengine_coretext.mm:59: error: expected primary-
expression before ‘const’
text/qfontengine_coretext.mm:53: warning: ‘SYNTHETIC_ITALIC_SKEW’ 
defined but not used
make[2]: *** [.obj/debug-shared/qfontengine_coretext.o] Error 1
make[1]: *** [debug] Error 2
make: *** [sub-gui-make_default-ordered] Error 2

我有用于10.7和10.8的Xcode Mac base SDK。

QPA是Qt平台抽象,您可以在其中为嵌入式系统开发自己的插件。它基本上取代了平台端口

QP5在QT5中有很好的发展,也许你可以考虑使用它。 您需要自己解决这些编译问题,如果您正计划如何使用QPA,最小插件是最佳选择

基本上,您可以通过包含ApplicationService框架和标题来解决这些问题。希望这有帮助

./configure -debug -opensource -confirm-license -arch "x86_64" -cocoa -qpa