最近遇到的问题,是我同事找到的解决办法,这里记录一下
报错
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 i386clang: error: linker command Failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture x86_64: "_opendir$INODE64",referenced from: _OPENSSL_DIR_read in libcocos2dx iOS.a(o_dir.o) "_readdir$INODE64",referenced from: _OPENSSL_DIR_read in libcocos2dx iOS.a(o_dir.o)ld: symbol(s) not found for architecture x86_64clang: error: linker command Failed with exit code 1 (use -v to see invocation)
解决方案:
extern "C"{ //新增代码#if defined (__unix) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)#ifndef __ENABLE_COMPATIBIliTY_WITH_UNIX_2003__#define __ENABLE_COMPATIBIliTY_WITH_UNIX_2003__#include <stdio.h>#include <dirent.h> file *fopen$UNIX2003( const char *filename,const char *mode ) { return fopen(filename,mode); } 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); } DIR *opendir$INODE64(const char * a) { return opendir(a); } struct dirent *readdir$INODE64(DIR *dir) { return readdir(dir); } #endif#endif //结束#include "png.h"#include "tiffio.h"#include "base/etc1.h"#include "jpeglib.h"}总结
以上是内存溢出为你收集整理的Cocos2d-x3.1 工程Xcode6编译时的问题全部内容,希望文章能够帮你解决Cocos2d-x3.1 工程Xcode6编译时的问题所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)