想目中不免会引入一些静态库,可是有时加入'.a'文件后编译便会报以下错误

ld: warning: ignoring file ”…/XXX.a”, file was built for archive which is not the architecture being linked (armv7): “…/XXX.a”
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_XXX", referenced from:
objc-class-ref in XXX.o

百度得到的第一页的大部分答案是找不到路径或'.a'文件缺失

参考:http://www.cocoachina.com/bbs/read.php?tid-247940.html

http://blog.csdn.net/kaizi318/article/details/10362673

http://www.cnblogs.com/zxykit/p/5165857.html

http://blog.csdn.net/bindu27227/article/details/23706369

但是这并不能解决这次遇到的问题

这次的文件导入后出现一个奇怪的现象,模拟器和iOS 9.3.1的真机调试都会报上面出现的错误,但是iOS 10.2.1却可以正常运行。

问题大体可以定位到以下几处:

1.工程没有找到导入的'.a'的路径。

  解决:查看Library Search Paths看看是否包含了相应的静态库的路径(参考http://blog.csdn.net/u012703795/article/details/24464837)。

2.导入的'.a'文件有问题

  解决:查看'.a'文件支持的arm指令集(参考:http://stackoverflow.com/questions/34844932/error-ld-warning-ignoring-file-libfile01-a-file-was-built-for-archive-which

和 http://blog.csdn.net/lvxiangan/article/details/42486731)

经过上面的操作后发现这次导入的'.a'文件仅支持arm64,这样的'.a'文件也是醉醉的

于是将Valid Architectures 改为仅有arm64,再次编译运行。。。

这次该好了吧,然而并没有

lb ‘/…/XXX.a’ does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
clang: error: linker command failed with exit code (use -v to see invocation)

解决:参考http://blog.csdn.net/zhyl8157121/article/details/48528831

再次运行,OK

静态库引入引起的错误解决方案,ld: warning: ignoring file ”…/XXX.a”, file was built for archive which is not the architecture being linked (armv7): “…/XXX.a” Undefined symbols for architecture armv7: "_OBJC_CLASS_$的更多相关文章

  1. Undefined symbols for architecture armv7: "_OBJC_METACLASS_$_ _OBJC_CLASS_$_ ld: symbol(s) not found for architecture armv7错误

    Undefined symbols for architecture armv7:  "_OBJC_METACLASS_$_MWPhotoBrowser", referenced ...

  2. iOS工程集成支付宝错误Undefined symbols for architecture armv7

    问题描述: 新工程中需要集成支付宝功能,于是咱就把支付宝的库给集成了进入然后就出现了下面这种错误了说,错误信息如下: Undefined symbols for architecture armv7: ...

  3. Undefined symbols for architecture armv7错误解决方法

    Undefined symbols for architecture armv7: "_OBJC_CLASS_$_BriefMainModel", referenced from: ...

  4. Xcode调用旧版本库出现Undefined symbols for architecture x86_64: ld: symbol(s) not found for architecture x86_64

    问题:Undefined symbols for architecture x86_64:   ld: symbol(s) not found for architecture x86_64 问题原因 ...

  5. 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 ...

  6. iOS出现 Undefined symbols for architecture armv7 std::basic_string<char, std::char_traits<char>

    Undefined symbols for architecture i386: “_OBJC_CLASS_$_XXX”, referenced from: objc-class-ref in XXX ...

  7. Undefined symbols for architecture arm64解决方案

    在iOS开发中经常遇到的一个错误是Undefined symbols for architecture arm64,这个错误表示工程某些地方不支持arm64指令集.那我们应该怎么解决这个问题了?我们不 ...

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

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

  9. Undefined symbols for architecture armv7

    xcode编译过程中出现如下问题Undefined symbols for architecture armv7:... ld: symbol(s) not found for architectur ...

随机推荐

  1. SSRS 浮动表头设置

    报表的Header部分,在出现分页或者多页的时候仍然会在其他页显示,但是在报表的Body中如果使用Tablix(矩阵)时,行/列标题翻页时候并没有保持固定.解决办法: (1): 左键单击矩阵(Tabl ...

  2. MapReduce源码分析之Task中关于对应TaskAttempt存储Map方案的一些思考

    我们知道,MapReduce有三层调度模型,即Job——>Task——>TaskAttempt,并且: 1.通常一个Job存在多个Task,这些Task总共有Map Task和Redcue ...

  3. Consul实现原理系列文章2: 用Gossip来做集群成员管理和消息广播

    工作中用到了Consul来做服务发现,之后一段时间里,我会陆续发一些文章来讲述Consul实现原理.这篇文章会讲述Consul是如何使用Gossip来做集群成员管理和消息广播的. Consul使用Go ...

  4. 在linux中使用sqlplus的上下左右箭头的方法

    在linux下面使用sqlpus连接数据库处理,实在不是很方便,还好有一个工具rlwrap,通过这个能够调用历史命令和回调功能,能够极大的提高效率. 1. 下载 从http://utopia.know ...

  5. Servlet 编写过滤器

    Servlet 过滤器可以动态地拦截请求和响应,以变换或使用包含在请求或响应中的信息. 可以将一个或多个 Servlet 过滤器附加到一个 Servlet 或一组 Servlet.Servlet 过滤 ...

  6. 百度map

    <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...

  7. day9笔记--文件操作

    文件操作  计算机系统分为:计算机硬件,操作系统,应用程序三部分. 我们用python或其他语言编写的应用程序若想要把数据永久保存下来,必须要保存于硬盘中,这就涉及到应用程序要操作硬件,众所周知,应用 ...

  8. 【BZOJ2064】分裂 状压DP

    [BZOJ2064]分裂 Description 背景:和久必分,分久必和...题目描述:中国历史上上分分和和次数非常多..通读中国历史的WJMZBMR表示毫无压力.同时经常搞OI的他把这个变成了一个 ...

  9. 《从零开始学Swift》学习笔记(Day 22)——闭包那些事儿!

    原创文章,欢迎转载.转载请注明:关东升的博客    我给Swift 中的闭包一个定义:闭包是自包含的匿名函数代码块,可以作为表达式.函数参数和函数返回值,闭包表达式的运算结果是一种函数类型. Swif ...

  10. C#中enum的总结(转载)

    1.关于enum的定义 enum Fabric { Cotton = 1, Silk = 2, Wool = 4, Rayon = 8, Other = 128 } 2.符号名和常数值的互相转换   ...