想目中不免会引入一些静态库,可是有时加入'.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. 分布式服务框架 Zookeeper(四)官方编程指南

    握草,是不是加了官方两个字就可以唬人了. 使用ZooKeeper开发分布式应用 简介 这篇文档是为了那些想利用ZooKeeper的协调服务来构建分布式应用的开发人员而写滴,不相干的走一边去哈.在这儿有 ...

  2. abp 列表和明细页面的规则说明

    0>列表区域mainviewbody 1>列表头mainviewheader 名称 2>列表条件mainviewcodtionbody 条件区 3>列表工具栏mainviewt ...

  3. 2017-5-14 湘潭市赛 Longest Common Subsequence 想法题

    Longest Common Subsequence Accepted : Submit : Time Limit : MS Memory Limit : KB Longest Common Subs ...

  4. Hbuilder MUI 注册短信验证60秒后重新发送

    <div class="mui-input-row"> <label class="iconfont_log_reg icon-youjian" ...

  5. Audiosink design

    Audiosink的设计,需要满足下列一些需求: 良好的chain_based 支持.绝大多数简单playback pipelines都是将音频数据从decoder直接push给audiosink; ...

  6. Spring MVC文本框

    以下示例显示如何使用Spring Web MVC框架在表单中使用文本框.首先使用Eclipse IDE来创建一个Web工程,按照以下步骤使用Spring Web Framework开发基于动态表单的W ...

  7. asp.net mvc FormsAuthentication一些问题

    form验证最简单的一句 FormsAuthentication.SetAuthCookie(”userName", false); web.config里加上    <machine ...

  8. Android 自定义键盘车牌号输入

    参考资料 :https://github.com/winterPei/LicensePlateUtil 自定义优化代码: https://gitee.com/anan9303/LicensePlate ...

  9. keras常用的网络层

    一.常用层 常用层对应于core模块,core内部定义了一系列常用的网络层,包括全连接.激活层等. 1.Dense层 Dense层:全连接层. keras.layers.core.Dense(outp ...

  10. using 关键字的使用

    using 关键字的使用主要分为两种类型:using declaration(using 声明)和using directive(using 命令): using 声明:引入特定名称空间中的一个成员. ...