简体   繁体   English

尝试为iOS构建静态库时出现错误

[英]Errors when trying to build static library for iOS

I have empty static library for iOS (empty, means - I have just one interface defined without any methods), when I try to build it I get bunch of errors like: 我有一个用于iOS的空静态库((空的,意味着-我只定义了一个接口,没有任何方法)),当我尝试构建它时,出现一堆错误,例如:

In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:120:25: error: expected a type
- (id)initWithIdentity:(SecIdentityRef)identity certificates:(NSArray *)certArray persistence:(NSURLCredentialPersistence) persistence NS_AVAILABLE(10_6, 3_0);
                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:130:46: error: expected a type
+ (NSURLCredential *)credentialWithIdentity:(SecIdentityRef)identity certificates:(NSArray *)certArray persistence:(NSURLCredentialPersistence)persistence NS_AVAILABLE(10_6, 3_0);
                                             ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:137:4: error: expected a type
- (SecIdentityRef)identity;
   ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:155:22: error: expected a type
- (id)initWithTrust:(SecTrustRef)trust NS_AVAILABLE(10_6, 3_0);
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:162:42: error: expected a type
+ (NSURLCredential *)credentialForTrust:(SecTrustRef)trust NS_AVAILABLE(10_6, 3_0);
                                         ^
In file included from /Users/p-kir/Work/SourceRepos/iDev_GIT/Tests/AllTests/AllTests/AllTests-Prefix.pch:6:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:77:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLProtectionSpace.h:237:4: error: expected a type
- (SecTrustRef)serverTrust NS_AVAILABLE(10_6, 3_0);

Does anyone know what could be causing this? 有谁知道是什么原因造成的? Thanks. 谢谢。

SecIdentityRef and SecTrustRef are defined in the Security.framework . SecIdentityRefSecTrustRefSecurity.framework中定义。 Make sure you are importing the proper header file: 确保要导入正确的头文件:

#import <Security/Security.h>

and add the Security.framework to your project. 并将Security.framework添加到您的项目中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM