错误( linker command failed with exit code 1)

错误1:

Undefined symbols for architecture x86_64:

"_OBJC_CLASS_$_SQLiteManager", referenced from:

objc-class-ref in CLStatusdDAL.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

.h及.m文件

解决:

错误( linker command failed with exit code 1)

首先找到画横线的文件,然后按下图操作:

错误( linker command failed with exit code 1)

错误2:

新添加的第三方库,不是静态库,报此类错误,做下图操作

错误( linker command failed with exit code 1)

将此属性修改成$(inherited),-ObjC,-all_load  ,或者也可以直接缺什么直接按照此格式-l"SDWebImage"来直接添加,其实后面直接可以替换为-all_load

错误3:

添加的是第三方静态库(.a文件)

这种情况就可能是这个静态库路径混乱导致的链接错误

错误( linker command failed with exit code 1)

解决方法:Build settings->Search Path->Library Search Paths  添加静态库的相应路径

其他:

还有可能文件名字相同,找出相同的其中一个删掉就ok,不过上面的几种方法亲身测试,基本可解决

有兴趣一起交流学习的小伙伴,欢迎加入技术交流q群:150731459,一起进步!共同努力!