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!