当将AFNetworking添加到工程后编译时出现

Undefined symbols for architecture i386:
"_SecCertificateCopyData", referenced from:
_AFCertificateTrustChainForServerTrust in AFSecurityPolicy.o
"_SecCertificateCreateWithData", referenced from:
_AFPublicKeyForCertificate in AFSecurityPolicy.o
"_SecPolicyCreateBasicX509", referenced from:
_AFPublicKeyForCertificate in AFSecurityPolicy.o
_AFPublicKeyTrustChainForServerTrust in AFSecurityPolicy.o
"_SecTrustCopyPublicKey", referenced from:
_AFPublicKeyForCertificate in AFSecurityPolicy.o
_AFPublicKeyTrustChainForServerTrust in AFSecurityPolicy.o
"_SecTrustCreateWithCertificates", referenced from:
_AFPublicKeyForCertificate in AFSecurityPolicy.o
_AFPublicKeyTrustChainForServerTrust in AFSecurityPolicy.o
"_SecTrustEvaluate", referenced from:
_AFPublicKeyForCertificate in AFSecurityPolicy.o
_AFServerTrustIsValid in AFSecurityPolicy.o
_AFPublicKeyTrustChainForServerTrust in AFSecurityPolicy.o
"_SecTrustGetCertificateAtIndex", referenced from:
_AFCertificateTrustChainForServerTrust in AFSecurityPolicy.o
_AFPublicKeyTrustChainForServerTrust in AFSecurityPolicy.o
"_SecTrustGetCertificateCount", referenced from:
_AFCertificateTrustChainForServerTrust in AFSecurityPolicy.o
_AFPublicKeyTrustChainForServerTrust in AFSecurityPolicy.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code (use -v to see invocation)

此时需要导入3个frameworks

CFNetwork.framework
Security.framework
SystemConfiguration.framework

我在将AFNetworking 2.0添加到cocos2d的工程项目时,首席必须将与AFNetworking 2.0有关的文件都变成ARC,具体步骤

Edit-》Refactor-》Convert to Objective-c ARC...,然后将与AFNetworking 2.0有关的文件选上,继续就行

编译时还可能出现“The current deployment target does not support automated __weak references”,此时需要将__weak变成__unsafe_unretained

还可能在

@property (nonatomic, strong) dispatch_queue_t completionQueue;

出现Property with 'retain(or strong)' attribute must be of object type错误,此时将上面变成

@property (nonatomic, assign) dispatch_queue_t completionQueue;

就可以编译通过

如果感觉麻烦可以试着先创建Application的工程,然后将AFNetwork 2.0添加进去,此时编译不会报错,然后再将cocos2d添加进去

按照cocos2d中的AppDelegate修改一下AppDelegate的内容即可,此方法有待尝试

当编译AFNetworking 2.0时出现了Undefined symbols for architecture i386的更多相关文章

  1. oc调用c++接口时 报错 Undefined symbols for architecture i386:

    当在oc中调用c++中的方法时,发现说c++中的方法没定义或是找不到 Undefined symbols for architecture i386: "_desTYData", ...

  2. 添加第三方类库造成的Undefined symbols for architecture i386:编译错误

    1.原因: 如果是源码编译的话,一般就只某些头文件没有添加到src编译里面.但是对于添加库编译,一般是库的编译路径设置不正确(比如arm的版本.模拟器或者真机的不同版本库引用错误或者重复引用一起编译器 ...

  3. iOS:编译错误Undefined symbols for architecture i386: _OBJC_CLASS_$_XXX", referenced from: error

    Undefined symbols for architecture i386: _OBJC_CLASS_$_XXX", referenced from: error 这个意思为无法找到名为 ...

  4. iOS编译错误#ld: warning: ignoring file# 之 Undefined symbols for architecture x86_64 - ld: symbol(s) not found for architecture x86_64

    ld: warning: ignoring file xxxPath/libbaidumapapi.a, missing required architecture x86_64 in file xx ...

  5. Xcode编译Undefined symbols for architecture xxx 错误总结

    可能会遇到这几种错误:Undefined symbols for architecture armv7Undefined symbols for architecture armv7sUndefine ...

  6. MinGW下编译curl-7.60.0时, 发生ERROR_FILE_NOT_FOUND undeclared

    在编译curl-7.60.0时, 遇到ERROR_FILE_NOT_FOUND undeclared 这个情况, 就没法编译成功!! 下载了以往的版本, 发现是从curl-7.59.0版本开始才有 t ...

  7. ios build时,Undefined symbols for architecture xxx问题的总结

    简单来说,Undefined symbols基本上等于JAVA的ClassNotFoundException,最常见的原因有这几种: build的时候没有加framework 比如说,有一段代码我用了 ...

  8. 编译gcc5.1.0时的报错

    编译安装gcc5.1.0时出现如下报错: configure: error: error verifying int64_t uses long long 这是由于没有安装gcc_c++导致的,安装下 ...

  9. 用xcode6.3编译早期工程时出现Undefined symbols for architecture x86_64错误的解决办法(转)

    Xcode升级到5.1 新特性之一就是默认让所有App都通过64位编译器编译.原来在Xcode5.0.x的时候默认的Standard architectures只有(arm7,armv7s),到5.1 ...

随机推荐

  1. jQuery ajax同步的替换方法,使用 $.Deferred()对象

    function aa() { var defer = $.Deferred(); $.ajax({ url: "/Handler1.ashx", type: "post ...

  2. n的阶乘高精度算法【阶乘】

    C语言实验——求阶乘(循环结构) Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 题目链接:http://acm.sdut.edu ...

  3. 【openGL】四面体

  4. 【Agorithm】一次一密加密解密算法

    #include<iostream> #include<cstdio> #include<cstdlib> #include<ctime> #inclu ...

  5. dbca:Exception in thread "main" java.lang.UnsatisfiedLinkError: get

    在64位的操作系统安装oracle10g 软件安装完成后,使用dbca建库的时候报下面的错: $ dbcaUnsatisfiedLinkError exception loading native l ...

  6. postgresql设置默认的search_path

    -- Use this to show the current search_path -- Should return: "$user",public SHOW search_p ...

  7. yaf框架使用(centos6.5)

    安装好php环境之后 安装扩展包 $yum install php-devel /usr/bin/ 就会出现phpize工具包 下载yaf-2.2.8.gz源文件,解压后,进入源文件 phpize [ ...

  8. android 入门-android属性介绍

      android:visibility="gone" 不保留view控件所占有的空间 隐藏 android:visibility="invisible" 保留 ...

  9. 新浪微博的账号登录及api操作

    .sina.php <?php /** * PHP Library for weibo.com * * @author */ class sinaPHP { function __constru ...

  10. 第三篇:用SOUI能做什么?

    SOUI-DEMO界面预览 在回答SOUI能做什么之前,先看看SVN中demo工程的界面截图: 使用SOUI实现上面的界面主要的工作全在配置几个XML文件,基本不需要写C++代码.(如何配置XML布局 ...