首页 > 代码库 > mac cocos2dx android
mac cocos2dx android
1.
localhost:proj.android mxhd4$ ./build_native.sh
报错
make: Leaving directory `/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android‘
解决方法:vi /Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../CocosDenshion/android/SimpleAudioEngine.cpp
line :159 凝视
2.
localhost:proj.android mxhd4$ ./build_native.sh
报错
Compile++ thumb : cocosdenshion_static <= SimpleAudioEngine.cpp
Compile++ thumb : cocosdenshion_static <= OpenSLEngine.cpp
/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../CocosDenshion/android/opensl/OpenSLEngine.cpp: In function ‘bool initAudioPlayer(AudioPlayer*, char const*)‘:
/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../CocosDenshion/android/opensl/OpenSLEngine.cpp:292:45: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
[enabled by default]
/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../CocosDenshion/android/opensl/OpenSLEngine.cpp:292:45: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
[enabled by default]
/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../CocosDenshion/android/opensl/OpenSLEngine.cpp: In member function ‘void OpenSLEngine::createEngine(void*)‘:
/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../CocosDenshion/android/opensl/OpenSLEngine.cpp:324:3: error: format not a string literal and no format arguments [-Werror=format-security]
cc1plus: some warnings being treated as errors
make: *** [obj/local/armeabi/objs-debug/cocosdenshion_static/opensl/OpenSLEngine.o] Error 1
make: Leaving directory `/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android‘
解决方法:vi /Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../CocosDenshion/android/opensl/OpenSLEngine.cpp
line:324:凝视
3.
localhost:proj.android mxhd4$ ./build_native.sh
报错
Compile++ thumb : cocosdenshion_static <= OpenSLEngine.cpp
/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../CocosDenshion/android/opensl/OpenSLEngine.cpp: In function ‘bool initAudioPlayer(AudioPlayer*, char const*)‘:
/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../CocosDenshion/android/opensl/OpenSLEngine.cpp:292:45: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../CocosDenshion/android/opensl/OpenSLEngine.cpp:292:45: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
Compile++ thumb : cocosdenshion_static <= SimpleAudioEngineOpenSL.cpp
/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../CocosDenshion/android/opensl/SimpleAudioEngineOpenSL.cpp: In member function ‘bool SimpleAudioEngineOpenSL::initEngine()‘:
/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../CocosDenshion/android/opensl/SimpleAudioEngineOpenSL.cpp:41:5: error: format not a string literal and no format arguments [-Werror=format-security]
cc1plus: some warnings being treated as errors
make: *** [obj/local/armeabi/objs-debug/cocosdenshion_static/opensl/SimpleAudioEngineOpenSL.o] Error 1
解决方法:vi /Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../CocosDenshion/android/opensl/SimpleAudioEngineOpenSL.cpp:
line:41:凝视
4.
localhost:proj.android mxhd4$ ./build_native.sh
Compile++ thumb : cocos2dx_static <= CCCommon.cpp
/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../cocos2dx/platform/android/CCCommon.cpp: In function ‘void cocos2d::CCLog(char const*, ...)‘:
/Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../cocos2dx/platform/android/CCCommon.cpp:44:72: error: format not a string literal and no format arguments [-Werror=format-security]
cc1plus: some warnings being treated as errors
make: *** [obj/local/armeabi/objs-debug/cocos2dx_static/platform/android/CCCommon.o] Error 1
解决方法:vi /Users/mxhd4/Movies/2.0.4/cocos2d-2.0-x-2.0.4/test_cocos2dx_mac/proj.android/../../cocos2dx/platform/android/CCCommon.cpp
line:44:凝视
5.
将res Icon.png拷贝到项目对应文件夹中,
将cocos2dx/platform/android/java/org文件夹复制一份到项目project的src对应文件夹中
buildpath remove Android Dependency
mac cocos2dx android