第三方库报错
开发中难免需要导入第三方库,导库之后编译报错:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_MyPageLogViewController", referenced from:
objc-class-ref in BaiduMobStatAppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解决方法是在Build settings
->Linking
->Other Linker Flags
中添加-ObjC
如图所示:
静态库报错
导入第三方静态库.a
的时候,有的时候也会报错:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_BaiduMobStat", referenced from:
objc-class-ref in libLECLivePlayerUISDK.o
objc-class-ref in libLECLivePlayerSDK.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
这种情况下先看下是否是导入的库重复了,或者是没有引用,如果是导库冲突了,删除按照官方文档重新导入,如果是没有引用,在Build settings
->Search Path
->Library Search Paths
中引入静态库路径,如图: