OS : MacOS
Version : cocos2d-x-4.0
# 생성
cocos new MyGame1 -p com.electromotor.mygame1 -l cpp
1. step
MacBookPro cocos2d-x-4.0 % cocos new MyGame1 -p com.electromotor.mygame1 -l cpp
> Copy template into /Users/electromotor/Documents/cocos2dx/cocos2d-x-4.0/MyGame1
> Copying Cocos2d-x files…
> Rename project name from ‘HelloCpp’ to ‘MyGame1’
> Replace the project name from ‘HelloCpp’ to ‘MyGame1’
> Replace the project package name from ‘org.cocos2dx.hellocpp’ to ‘com.electromotor.mygame1’
> Replace the Mac bundle id from ‘org.cocos2dx.hellocpp’ to ‘com.electromotor.mygame1’
> Replace the iOS bundle id from ‘org.cocos2dx.hellocpp’ to ‘com.electromotor.mygame1’
2. step
cd MyGame1
# 컴파일 & 실행
3. step
cocos run -p ios
MacBookPro MyGame1 % cocos run -p ios
Building mode: debug
running: ‘cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator’
— The C compiler identification is AppleClang 13.1.6.13160021
— The CXX compiler identification is AppleClang 13.1.6.13160021
— Detecting C compiler ABI info
— Detecting C compiler ABI info – done
— Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang – skipped
— Detecting C compile features
— Detecting C compile features – done
— 중략 —
/Users/electromotor/Documents/cocos2dx/cocos2d-x-4.0/MyGame1/ios-build/MyGame1.xcodeproj: warning: The iOS Simulator deployment target ‘IPHONEOS_DEPLOYMENT_TARGET’ is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.5.99. (in target ‘cocos2d’ from project ‘MyGame1’)
warning: ONLY_ACTIVE_ARCH=YES requested with multiple ARCHS and no active architecture could be computed; building for all applicable architectures (in target ‘cocos2d’ from project ‘MyGame1’)
** BUILD FAILED **
The following build commands failed:
Ld /Users/electromotor/Documents/cocos2dx/cocos2d-x-4.0/MyGame1/ios-build/MyGame1.build/Debug-iphonesimulator/MyGame1.build/Objects-normal/arm64/Binary/MyGame1 normal arm64 (in target ‘MyGame1’ from project ‘MyGame1’)
(1 failure)
Error running command, return code: 65.
4. step
# open MyGame1.xcodeproj
5. xcode other linker flags 변경