ld: ‘’ does not contain bitcode. You must rebuild it with bitcode enabled ...

来源:互联网 发布:成都gis软件培训班 编辑:程序博客网 时间:2024/06/05 14:49

今天编译工程,出现错误:

ld: ‘/Users/**/Framework/SDKs/**SDK.a(**.o)’ 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

这是由于第三方库不包括bitcode。


那么bitcode是什么呢?

bitcode是Xcode7的新特性。简单来说,Bitcode 是 LLVM-IR 在磁盘上的一种二进制表示形式。

官方文档中提到:

Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.

bitcode是被编译程序的一种中间形式的代码。包含bitcode配置的程序将会在App store上被编译和链接。bitcode允许苹果在后期重新优化程序的二进制文件,而不需要重新提交一个新的版本到App store上。


Bitcode. When you archive for submission to the App Store, Xcode will compile your app into an intermediate representation. The App Store will then compile the bitcode down into the 64 or 32 bit executables as necessary.

当提交程序到App store上时,Xcode会将程序编译为一个中间表现形式(bitcode)。然后App store会再将这个botcode编译为可执行的64位或32位程序。


当使用的第三方库不支持bitcode时,需要关闭bitcode.

配置bitcode如图:


在Xcode 7中,我们新建一个iOS程序时,bitcode选项默认是设置为YES的。


其他资料:《Xcode 7 Bitcode的工作流程及安全性评估》

0 0