2014-12-07 202 views
1

我刚刚建立了我的项目在新的iMac 10.10时,Xcode 6.1它只是得到下面这个错误:__AVAILABILITY_INTERNAL__MAC_10_10造成编译失败

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 OS X 10.9上,xcode6.1。 ,苹果有一些API更改为OSX 10.10 https://developer.apple.com/library/mac/documentation/General/Reference/APIDiffsMacOSX10_10SeedDiff/frameworks/Security.html

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

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

有人也遇到了这个错误,你如何解决它?

+0

可用性宏说了一些关于'__MAC_10_10',但框架的路径中有'MacOSX10.9.sdk'。这看起来至少对我很腥。您是否将最新的OS X SDK用作Base SDK? – 2014-12-07 06:28:52

+0

感谢Matthias。我使用的是10.9 sdk,因为在xcode6.1 SDK中,有10.10和10.9 sdk。但我使用的是MacOSX10.9 sdk。 – user1424963 2014-12-07 06:57:56

回答

1

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

+0

你需要改变或做什么才能完成切换? – Unheilig 2014-12-11 03:54:08

+1

我没有更改任何代码,只需更改构建命令,使用“-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk”。 – user1424963 2014-12-11 13:41:22

+0

感谢您的反馈。 – Unheilig 2014-12-11 14:58:44