_OBJC_CLASS_$_XXX", referenced from: objc-class-ref in XXX.o

1、可能是_XXX这个库少添加了相关编译文件,导致使用SDK时发现某个类被使用了,但是SDK中并未被编译进去。

2、如有以下警告
ignoring file /Users/xx/Library/Developer/Xcode/DerivedData/xxx-gizxvzlepunbjdhdraglweegrlgs/Build/Products/Debug-iphoneos/libVHCDocuments.a, file was built for archive which is not the architecture being linked (armv7): /Users/xxx/Library/Developer/Xcode/DerivedData/xxx-gizxvzlepunbjdhdraglweegrlgs/Build/Products/Debug-iphoneos/libXXX.a
则说明在编译项目的时候,libXXX.a这个库被忽略了,并未被编译,所以编译报错:

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

如果有这个错误,可能是编译Build Active Architecture Only处的设置不对,在Debug环境下设置为YES,Release环境下设置为NO即可。

设置为NO,编译的时候会根据当前的设备支持的环境进行编译,关于armv7,armv7s,arm64,i386,x86_64,具体的参考:https://blog.csdn.net/lizhongfu2013/article/details/42387311

3、引入静态库后,ibrary的searchPath的对

设置静态库的search path $(PROJECT_DIR)/../xxx/xxx/

你可能感兴趣的:(#,error,&,warning)