编译链接报错Undefined symbols for architecture arm64: referenced from :

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013943420/article/details/79826041

报错: Undefined symbols for architecture arm64: “_OBJC_CLASS_$_类名”, referenced from : Objc-class-ref in 类名.o


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

说明在xxxx类中引用的_OBJC_CLASS_$_JCAlertController(也就是JCAlertController),在编译或链接阶段未找到而导致报错。

解决步骤:

1. 选中工程TARGETS工程名 - Build Phases - Compile Sources - 添加所缺失的类(.m)


如果使用cocoapods引入了第三方类库,导致这个报错,可能是因为.a文件未找到导致的,需要在Link Binary With Libraries中引入缺失的三方库,步骤同上。

2. 将其引入进来,在使用命令 shift + command + k 清除一下缓存,在 command + b 重新编译即可。2

猜你喜欢

转载自blog.csdn.net/u013943420/article/details/79826041