Yosemite上的Xcode 7:XCTest不再编译.mm objective-c ++文件

时间:2015-10-11 23:39:28

标签: xcode macos osx-yosemite xcode7 objective-c++

在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之外,有没有人知道解决方法?

感谢。

0 个答案:

没有答案