使用環(huán)信時(shí)如果如果出現(xiàn)以下兩個(gè)報(bào)錯(cuò):
"_fwrite$UNIX2003", referenced from:
和
linker command failed with exit code 1 (use -v to see invocation)
異常的詳細(xì)內(nèi)容為:
Undefined symbols for architecture i386: "_fwrite$UNIX2003", referenced from: _hex_dump_internal in libEaseMobClientSDK.a(dump.o) _pkt_dump_internal in libEaseMobClientSDK.a(dump.o)ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解決方法:
首先, 找到環(huán)信官方SDK中的 ChatDemo-UI3.0 里的 FixFopen.c文件, copy一份到自己的工程中
ChatDemo-UI3.0 里的 FixFopen.c文件
從這里拖拽也可以:
ChatDemo-UI3.0 里的 FixFopen.c文件
此時(shí)如果還解決不了(可能會(huì)變成報(bào)26個(gè)紅),
就在自己工程的pch文件加入 #ifdef __OBJC__
和 #endif
修改pch文件示例