symbol(s) not found for architecture i386问题的解决方案。

来源:互联网 发布:淘宝店铺利润分析 编辑:程序博客网 时间:2024/05/06 12:03
使用最新版本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:
  1. #ifdef DEBUG
  2.     FILE *fopen$UNIX2003(const char *filename, const char *mode);
  3.     size_t fwrite$UNIX2003(const void *ptr, size_t size, size_t nitems, FILE *stream);
  4. #endif
复制代码
2、添加如下代码到AppDelegate.m:
  1. #ifdef DEBUG
  2. FILE *fopen$UNIX2003(const char *filename, const char *mode) {
  3.     return fopen(filename, mode);
  4. }

  5. size_t fwrite$UNIX2003(const void *ptr, size_t size, size_t nitems, FILE *stream) {
  6.     return fwrite(ptr, size, nitems, stream);
  7. }
  8. #endif
复制代码

0 0
原创粉丝点击