解决XCode6.0编译 cocos2d-x报错_fwrite$UNIX2003 “_strerror$UNIX2003″,
  admin 发表于 2014-09-20 08:45  分类:技术资料  5,244 次阅读  0条评论

Undefined symbols for architecture i386:
 "_fwrite$UNIX2003", referenced from:
     _unixErrorHandler in libcocos2dx iOS.a(tif_unix.o)
     _unixWarningHandler in libcocos2dx iOS.a(tif_unix.o)
     _empty_output_buffer in libcocos2dx iOS.a(jdatadst.o)
     _term_destination in libcocos2dx iOS.a(jdatadst.o)
     _Fax3PrintDir in libcocos2dx iOS.a(tif_fax3.o)
     _PredictorPrintDir in libcocos2dx iOS.a(tif_predict.o)
 "_strerror$UNIX2003", referenced from:
     _TIFFOpen in libcocos2dx iOS.a(tif_unix.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

把xcode升级到 6.0以后,编译cocos2d-x3.0的时候 报如上错误。找到了临时的解决方法:

暂时的解决方案是在AppDelegate.cpp文件的最后加上一下代码:

extern "C"{

   size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d )

   {

       return fwrite(a, b, c, d);

   }

   char* strerror$UNIX2003( int errnum )

   {

       return strerror(errnum);

   }

}

本文固定链接: http://www.youduoshao.com/2014-09-20/201409202325.html

填写您的称呼和邮箱即可发布评论

快捷键:Ctrl+Enter