COCOS2DX 3.x iOS Project compilation error!

Source: Internet
Author: User

Error:

Add the following code to the AppDelegate.cpp:

 extern   "    {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< /span> Errnum) { return   Strerror (errnum); }} 

uses the Libcrul library and compiles with a 5s or 6 emulator (estimated to be a 64-bit processor):
Error:


in the project catalog Cocos2dx/cocos/platform directory, Modify the CCImage.cpp file:

to find the code first:
extern "C" {#include "png.h" #include "tiffio.h" #include "base/etc1.h" #include "jpeglib.h"}

Add the following code to the code:

#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

1 extern "C"2 {3#include"png.h"4#include"tiffio.h"5#include"Base/etc1.h"6#include"Jpeglib.h"7 #ifDefined (__unix) | | (Cc_target_platform = = Cc_platform_ios)8 #ifndef __enable_compatibility_with_unix_2003__9 #define__enable_compatibility_with_unix_2003__Ten#include <stdio.h> One#include <dirent.h> AFILE *fopen$unix2003 (Const Char*filename,Const Char*mode) -     { -         returnfopen (filename, mode); the     } -size_t fwrite$unix2003 (Const void*a, size_t B, size_t C, FILE *d) -     { -         returnFwrite (A, B, C, d); +     } -     Char*STRERROR$UNIX2003 (interrnum) +     { A          at         returnstrerror (errnum); -     } -      -DIR *opendir$inode64 (Const Char*a) -     { -         returnOpendir (a); in     } -      to     structDirent *readdir$inode64 (DIR *dir) +     { -         returnReaddir (dir); the     } *      $ #endifPanax Notoginseng #endif -}

COCOS2DX 3.x iOS Project compilation error!

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.