【问题标题】:__AVAILABILITY_INTERNAL__MAC_10_10 causing compile failure__AVAILABILITY_INTERNAL__MAC_10_10 导致编译失败
【发布时间】:2014-12-07 05:48:59
【问题描述】:

我刚刚在新的 iMac 10.10、xcode 6.1 中构建了我的项目,它只是在下面出现这个错误:

In file included from /System/Library/Frameworks/Security.framework/Headers/Security.h:54:
/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h:43:1: error: expected function body after function declarator
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/Availability.h:159:50: note: expanded from macro
'__OSX_AVAILABLE_STARTING'
    #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_osx
                                                 ^
<scratch space>:43:1: note: expanded from here
__AVAILABILITY_INTERNAL__MAC_10_10
^

这看起来不像是我的项目问题,因为该项目在我的 mac osx 10.9、xcode6.1 上构建正常。 ,并且苹果对 osx 10.10 https://developer.apple.com/library/mac/documentation/General/Reference/APIDiffsMacOSX10_10SeedDiff/frameworks/Security.html 进行了一些 api 更改。

我搜索了错误,找到另一个链接https://github.com/pipobscure/fsevents/issues/40,其他人也遇到了这个错误,他通过重新安装命令行工具解决了这个问题。

但是对于我的问题,我重新安装了 xcode 和命令行工具。它不起作用,并且错误仍然存​​在。

有没有人也遇到过这个错误,你是怎么解决的?

【问题讨论】:

  • 可用性宏说明了__MAC_10_10,但框架在其路径中有MacOSX10.9.sdk。这在我看来至少是可疑的。您是否使用最新的 OS X SDK 作为 Base SDK?
  • 谢谢马蒂亚斯。我使用的是 10.9 sdk,因为在 xcode6.1 SDK 中,有 10.10 和 10.9 sdk。但我使用的是 MacOSX10.9 sdk。

标签: xcode macos osx-yosemite


【解决方案1】:

使用 OSX SDK 10.10 后,此错误不存在。

【讨论】:

  • 你必须改变或做什么才能进行转换?
  • 我没有更改任何代码,只是更改构建命令,使用“-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10 .sdk”。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-16
  • 1970-01-01
  • 1970-01-01
  • 2015-11-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多