Solve the Cocos2d-x3.0, 3.1 & quot; _ opendir $ INODE64 & quot; symbol (s) not found error, cocos2dx3.0

Source: Internet
Author: User

Solve the Cocos2d-x3.0, 3.1 "_ opendir $ INODE64" symbol (s) not found error, cocos2dx3.0

After upgrading the system and XCode, the following error will be reported for the project before compiling on IOS8:

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)
Apple originally planned to build its own set of OPenGL, all of which needed to be added based on the IOS platform. The solution to this problem is as follows:

Add the following code to cocos/platform/CCImage. cpp in the project directory:

#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
Reference: http://discuss.cocos2d-x.org/t/cocos2dx-with-ios-8-will-work/14621

Https://github.com/cocos2d/cocos2d-x/pull/6986


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.