移动开发stackflow

Xcode编译错误合集

2019-02-20  本文已影响0人  划落永恒

.a文件包含的文件库不包含.o文件

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_GLKView", referenced from:
      objc-class-ref in librtc_sdk_objc.a(RTCEAGLVideoView.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

.a文件包含的.o可能不支持arm64,如果不需要可以使用ar命令去掉.o文件

问题根源:

.a静态库导入是正常的,没问题。出现问题是因为这个文件可能确实无法编译arm64(因为iOS12之后苹果编译器不再支持armv7)。

本次的解决思路:

  1. 使用lipo 分别将.a拆分
    lipo xxxxx.a -thin armv7 -output xxx_new7.a
    lipo xxxxx.a -thin arm64 -output xxx_new64.a
  2. 使用ar命令删除其中一个.a的冲突的.o
    ar -d xxx_new7.a RTCEAGLVideoView.o
    ar -d xxx_new64.a RTCEAGLVideoView.o
  3. 使用lipo 合并
    lipo -create xxx_new7.a xxx_new64.a -output xxxxx_new.a
上一篇下一篇

猜你喜欢

热点阅读