2014-12-07 199 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