在OSX Yosemite(10.10.5)上更新到Xcode 7后,我的.mm
XCTest文件现在无法编译。我收到以下错误:
In file included from /Users/.../unit_test.mm:9:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.h:32:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h:985:49: error: expected ';' after top level declarator
extern const CFStringRef kSecUseAuthenticationUI
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h:987:54: error: expected ';' after top level declarator
extern const CFStringRef kSecUseAuthenticationContext
^
...
它所抱怨的所有内容都是这样的:
extern const CFStringRef kSecUseAuthenticationUI
__OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
extern const CFStringRef kSecUseAuthenticationContext
__OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
虽然这些声明没有问题:
extern const CFStringRef kSecUseItemList
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_2_0);
看起来更新添加了__MAC_10_11
行和.mm
文件,不再在OS 10.10上使用XCTest进行编译。
除了升级到OS 10.11之外,有没有人知道解决方法?
感谢。