IOS engineering, +cocos2d-x Engineering (Engineering finishing)

1, to get the game group project, the required file is frameworks inside cocos2d-x (you can also download your own cocos2d-X installation package, cool it)

IOS engineering, +cocos2d-x Engineering (Engineering finishing)
Game Engineering

2, the game works to open, test the game is not OK

IOS engineering, +cocos2d-x Engineering (Engineering finishing)
Game Engineering

3, copy cocos2d-x’s package to your own project, which is convenient for reference:

IOS engineering, +cocos2d-x Engineering (Engineering finishing)
copy cocos2d-x package

4, the introduction of the corresponding engineering documents, cocos2d_libs is necessary, because the game group used JS, so I added more cocos2d_js project, we add to the actual situation

IOS engineering, +cocos2d-x Engineering (Engineering finishing)
add project

5, in build phases inside add dependent library file, remember in target Dependencies inside also want to add, here everyone according to actual needs added on the line, remember to choose IOS.A file, don’t choose wrong

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

6, then proceed with the project configuration, in the build settings inside

(1) Valid architectures, which now generally defaults to arm64 armv7 armv7s, here we need

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

(2) the Enable Bitcode in Build Options is set to NO because the.A file does not support bitcode

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

(3) the Other linker flags in Linking is configured, the reason is forgotten, and the older brother added

$(_COCOS_LIB_IOS_BEGIN)

$(_COCOS_LIB_IOS_END)

-ObjC

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

(4) Search Paths inside Header, Search, Paths and Library Search Paths, according to their cocos2d-x path configuration, otherwise a pile of header files can not read

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

(5) in the Custom Compiler Flags Other C Flags inside

-DNS_BLOCK_ASSERTIONS=1

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

(6) Language configuration inside: pay attention to the path inside the PCH file

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

(7) Preprocessing inside the configuration, this is particularly important, or else build error, I’ve been grinding here for a long time!

CC_TARGET_OS_IPHONE, plus this,
!

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

(8) Warning configuration, feel this does not matter

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

7, this configuration is complete, the game project inside the file copy, joining the project, not missing

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

8, build, found a lot of mistakes is right, okay, slowly, the first game project inside the Classes inside the AppDelegate.h not to be renamed, and their works inside the same name

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

Corresponding to the code also changed, and other places to refer to the document, remember to change

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

9, another C code error, B, dog, I also find out, changed one by one,

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

10, engineering inside main.m change,

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

11.run wave of friendship tips, compile a lot of documents, you can go for a cup of coffee

IOS engineering, +cocos2d-x Engineering (Engineering finishing)

Follow up: next on the interactive call section, I’ll continue to cut it out! Come on!

IOS engineering +cocos2d-x Engineering (jump, code docking chapter): Code docking chapter