Home > Database > Mysql Tutorial > body text

解决Xcode 6 beta 编译Cocos2d

WBOY
Release: 2016-06-07 15:32:35
Original
1063 people have browsed it

在Xcode 6 beta里编译Cocos2d-x iOS项目时可能会失败,提示如下错误: Undefined symbols for architecture i386: _fwrite$UNIX2003, referenced from: _unixErrorHandler in libcocos2dx iOS.a(tif_unix.o) _unixWarningHandler in libcocos2dx iOS.a(tif_u

在Xcode 6 beta里编译Cocos2d-x iOS项目时可能会失败,提示如下错误:

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 beta 编译Cocos2d
解决方法很简单,只需要在AppDelegate.cpp中加入如下代码即可:

extern"C"{

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

    {

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

    }

    char* strerror$UNIX2003( int errnum )

    {

        return strerror(errnum);

    }

}


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template