|
使用最新版本xcode编译AnyChat时,会出现如下出错提示:
Undefined symbols for architecture i386:
"_fwrite$UNIX2003", referenced from:
_voAWB_dtx_enc_init in libvo-amrwbenc.a(dtx.o)
_voAWB_dtx_enc_reset in libvo-amrwbenc.a(dtx.o)
_wb_vad_init in libvo-amrwbenc.a(wb_vad.o)
_wb_vad_reset in libvo-amrwbenc.a(wb_vad.o)
_quant_4p_4N in libvo-amrwbenc.a(q_pulse.o)
_quant_5p_5N in libvo-amrwbenc.a(q_pulse.o)
_quant_6p_6N_2 in libvo-amrwbenc.a(q_pulse.o)
...
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
这是xcode的一个Bug,解决方案如下:
1、添加如下代码到AppDelegate.h:- #ifdef DEBUG
- FILE *fopen$UNIX2003(const char *filename, const char *mode);
- size_t fwrite$UNIX2003(const void *ptr, size_t size, size_t nitems, FILE *stream);
- #endif
复制代码 2、添加如下代码到AppDelegate.m:- #ifdef DEBUG
- FILE *fopen$UNIX2003(const char *filename, const char *mode) {
- return fopen(filename, mode);
- }
- size_t fwrite$UNIX2003(const void *ptr, size_t size, size_t nitems, FILE *stream) {
- return fwrite(ptr, size, nitems, stream);
- }
- #endif
复制代码 |
|