iOS 解决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)

使用环信时如果如果出现以下两个报错:

"_fwrite$UNIX2003", referenced from:

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

异常的详细内容为:

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)

解决方法:

首先, 找到环信官方SDK中的 ChatDemo-UI3.0 里的 FixFopen.c文件, copy一份到自己的工程中

iOS 解决Undefined symbols for architecture i386:
ChatDemo-UI3.0 里的 FixFopen.c文件

从这里拖拽也可以:


iOS 解决Undefined symbols for architecture i386:
ChatDemo-UI3.0 里的 FixFopen.c文件

此时如果还解决不了(可能会变成报26个红),

就在自己工程的pch文件加入 #ifdef __OBJC__#endif

iOS 解决Undefined symbols for architecture i386:
修改pch文件示例

你可能感兴趣的:(iOS 解决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))