首页 > 代码库 > Cocos2d-x 3.1.1 在Windows下搭建Android开发环境
Cocos2d-x 3.1.1 在Windows下搭建Android开发环境
Cocos2d-x 3.1.1 在Windows下搭建Android开发环境
本篇博客来给大家介绍如何在Windows下搭建Cocos2d-x Android开发环境,笔者前面写了几篇博客都是针对如何对Android项目进行交叉编译的,对应了Cocos2d-x 2.2.3版本和Cocos2d-x 3.0版本,其实3.0版本跟3.1.1是一样的,只是笔者介绍如何不适用命令行对Cocos2d-x Android项目进行交叉编译,而直接在Eclipse进行交叉编译。
前面几篇博客,如果有需要比较差别的话,童鞋们自行去查看:
Cocos2d-x 2.2.3 环境搭建
http://blog.csdn.net/wwj_748/article/details/23672799
cocos2d-x在win7下的android交叉编译环境
http://blog.csdn.net/wwj_748/article/details/23704141
Cocos2d-x 3.0 - Eclipse上构建一个Android项目
http://blog.csdn.net/wwj_748/article/details/24812277
其实讲了那么多,很多童鞋还是不明白为什么要这样配置,Cocos2d-x 3.x以上已经省去了使用Cygwin来对Android项目进行交叉编译了,可以直接使用NDK,所以我们配置的时候一定要配置NDK的路径。这里所说的配置路径是需要我们在Windows下配置系统环境变量,起初我们的系统是没有NDK路径的。如果我们不设置名为NDK_ROOT的环境变量是无法对项目进行交叉编译。
我们先来创建一个Cocos2d-x 3.x的项目,使用命令:
cocos new HelloCC -p com.wwj.hellocc -l cpp -d D:/Cocos2d-x/projects
这是大致的命令。意思是,在D盘的Cocossd-x目录下的projects目录下创建了一个名为HelloCC的项目,语言是C++
创建完之后,会有如下目录结构:
proj.android就是我们要导入到Eclipse中的项目,打开Eclipse,Import进来,有如下项目结构:
大家可以看到项目中有jni文件夹、build_native.py脚本,我们的Android项目就是通过执行build_native.py这个脚本来对我们的Android项目进行交叉编译的,我们需要编译的文件在jni里面:
笔者写了篇博客专门介绍这两个文件的作用,可以去看看:
http://blog.csdn.net/wwj_748/article/details/30055915
我们直接Build project
在控制台会出现以下提示:
这里说的意思是,NDK_ROOT没有定义,请在你的环境下定义NDK_ROOT
那么我就在我们所在的环境下配置如下的环境变量:
配置好之后,重启Eclipse,让我们刚配置的环境变量生效。
我们再次编译项目,会出现如下的编译过程:
**** Build of configuration Default for project HelloCC ****
python D:/Cocos2d-x/projects/HelloCC/proj.android/build_native.py all
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml
Android NDK: WARNING:D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static libraries
Android NDK: WARNING:D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/platform/android/Android.mk:cocos2dxandroid_static: LOCAL_LDLIBS is always ignored for static libraries
make.exe: Entering directory `D:/Cocos2d-x/projects/HelloCC/proj.android‘
[armeabi] Compile++ thumb: cocos2dcpp_shared <= main.cpp
[armeabi] Compile++ thumb: cocos2dcpp_shared <= AppDelegate.cpp
[armeabi] Compile++ thumb: cocos2dcpp_shared <= HelloWorldScene.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= cocos2d.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCAction.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCActionCamera.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCActionCatmullRom.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCActionEase.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCActionGrid.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCActionGrid3D.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCActionInstant.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCActionInterval.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCActionManager.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCActionPageTurn3D.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCActionProgressTimer.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCActionTiledGrid.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCActionTween.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCAnimation.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCAnimationCache.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCAtlasNode.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCClippingNode.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCComponent.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCComponentContainer.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCDrawNode.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCDrawingPrimitives.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCFont.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCFontAtlas.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCFontAtlasCache.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCFontCharMap.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCFontFNT.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCFontFreeType.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCGLBufferedNode.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCGrabber.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCGrid.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCLabel.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCLabelAtlas.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCLabelBMFont.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCLabelTTF.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCLabelTextFormatter.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCLayer.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCMenu.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCMenuItem.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCMotionStreak.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCNode.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCNodeGrid.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCParallaxNode.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCParticleBatchNode.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCParticleExamples.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCParticleSystem.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCParticleSystemQuad.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCProgressTimer.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCRenderTexture.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCScene.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCSprite.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCSpriteBatchNode.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCSpriteFrame.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCSpriteFrameCache.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTMXLayer.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTMXObjectGroup.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTMXTiledMap.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTMXXMLParser.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTextFieldTTF.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTileMapAtlas.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTransition.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTransitionPageTurn.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTransitionProgress.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTweenFunction.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCMesh.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCSprite3DDataCache.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCObjLoader.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCSprite3D.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCGLViewProtocol.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCFileUtils.cpp
In file included from D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./math/CCGeometry.h:32:0,
from D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./base/ccTypes.h:33,
from D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./platform/CCGLViewProtocol.h:29,
from D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./platform/CCGLViewProtocol.cpp:26:
D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./platform/CCGLViewProtocol.cpp: In member function ‘virtual void cocos2d::GLViewProtocol::handleTouchesMove(int, intptr_t*, float*, float*)‘:
D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./base/CCPlatformMacros.h:219:67: warning: format ‘%ld‘ expects argument of type ‘long int‘, but argument 2 has type ‘intptr_t {aka int}‘ [-Wformat=]
#define CCLOG(format, ...) cocos2d::log(format, ##__VA_ARGS__)
^
D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./platform/CCGLViewProtocol.cpp:318:13: note: in expansion of macro ‘CCLOG‘
CCLOG("Moving touches with id: %ld error", id);
^
[armeabi] Compile++ thumb: cocos2dx_static <= CCSAXParser.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCThread.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCImage.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCAffineTransform.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCGeometry.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCVertex.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= Mat4.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= MathUtil.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= Quaternion.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= TransformUtils.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= Vec2.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= Vec3.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= Vec4.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCAutoreleasePool.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCConfiguration.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCConsole.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCData.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCDataVisitor.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCDirector.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEvent.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventAcceleration.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventCustom.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventDispatcher.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventFocus.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventKeyboard.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventListener.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventListenerAcceleration.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventListenerCustom.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventListenerFocus.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventListenerKeyboard.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventListenerMouse.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventListenerTouch.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventMouse.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCEventTouch.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCIMEDispatcher.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCNS.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCProfiling.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCRef.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCScheduler.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCScriptSupport.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTouch.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCUserDefault.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCUserDefaultAndroid.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCValue.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= TGAlib.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= ZipUtils.cpp
In file included from D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./base/CCUserDefault.h:28:0,
from D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./base/CCUserDefaultAndroid.cpp:25:
D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./base/CCUserDefaultAndroid.cpp: In member function ‘void cocos2d::UserDefault::setDataForKey(const char*, const cocos2d::Data&)‘:
D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./base/CCPlatformMacros.h:219:67: warning: format ‘%d‘ expects argument of type ‘int‘, but argument 3 has type ‘ssize_t {aka long int}‘ [-Wformat=]
#define CCLOG(format, ...) cocos2d::log(format, ##__VA_ARGS__)
^
D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./base/CCUserDefaultAndroid.cpp:458:5: note: in expansion of macro ‘CCLOG‘
CCLOG("SET DATA FOR KEY: --%s--%d", value.getBytes(), value.getSize());
^
[armeabi] Compile++ thumb: cocos2dx_static <= atitc.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= base64.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= ccCArray.cpp
[armeabi] Compile thumb : cocos2dx_static <= ccFPSImages.c
[armeabi] Compile++ thumb: cocos2dx_static <= ccTypes.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= ccUTF8.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= ccUtils.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= etc1.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= s3tc.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCBatchCommand.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCCustomCommand.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCGLProgram.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCGLProgramCache.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCGLProgramState.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCGLProgramStateCache.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCGroupCommand.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCQuadCommand.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCMeshCommand.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCRenderCommand.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCRenderer.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTexture2D.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTextureAtlas.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCTextureCache.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= ccGLStateCache.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= ccShaders.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCArray.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCSet.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCString.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCDictionary.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCDeprecated.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCNotificationCenter.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCPhysicsBody.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCPhysicsContact.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCPhysicsJoint.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCPhysicsShape.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCPhysicsWorld.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCPhysicsBodyInfo_chipmunk.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCPhysicsContactInfo_chipmunk.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCPhysicsJointInfo_chipmunk.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCPhysicsShapeInfo_chipmunk.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= CCPhysicsWorldInfo_chipmunk.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= ConvertUTFWrapper.cpp
[armeabi] Compile thumb : cocos2dx_static <= ConvertUTF.c
[armeabi] Compile++ thumb: cocos2dx_static <= tinyxml2.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= ioapi.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= unzip.cpp
[armeabi] Compile++ thumb: cocos2dx_static <= edtaa3func.cpp
[armeabi] Compile thumb : cocos2dx_static <= xxhash.c
[armeabi] Compile++ thumb: cocosdenshion_static <= cddSimpleAudioEngine.cpp
[armeabi] Compile++ thumb: cocosdenshion_static <= ccdandroidUtils.cpp
[armeabi] Compile++ thumb: cocosdenshion_static <= cddandroidAndroidJavaEngine.cpp
[armeabi] Compile thumb : chipmunk_static <= chipmunk.c
[armeabi] Compile thumb : chipmunk_static <= cpArbiter.c
In file included from D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/../../cocos2d.h:113:0,
from D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/ccdandroidUtils.cpp:26:
D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/../../2d/CCLabelTTF.h:77:77: warning: ‘LabelTTF‘ is deprecated (declared at D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/../../2d/CCLabelTTF.h:59) [-Wdeprecated-declarations]
TextVAlignment vAlignment = TextVAlignment::TOP);
^
D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/../../2d/CCLabelTTF.h:81:105: warning: ‘LabelTTF‘ is deprecated (declared at D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/../../2d/CCLabelTTF.h:59) [-Wdeprecated-declarations]
static LabelTTF * createWithFontDefinition(const std::string& string, FontDefinition &textDefinition);
^
D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/../../2d/CCLabelTTF.h:116:30: warning: ‘LabelTTF‘ is deprecated (declared at D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/../../2d/CCLabelTTF.h:59) [-Wdeprecated-declarations]
static LabelTTF * create();
^
In file included from D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/../../cocos2d.h:114:0,
from D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/ccdandroidUtils.cpp:26:
D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/../../2d/CCLabelBMFont.h:88:186: warning: ‘LabelBMFont‘ is deprecated (declared at D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/../../2d/CCLabelBMFont.h:74) [-Wdeprecated-declarations]
static LabelBMFont * create(const std::string& str, const std::string& fntFile, float width = 0, TextHAlignment alignment = TextHAlignment::LEFT,const Vec2& imageOffset = Vec2::ZERO);
^
D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/../../2d/CCLabelBMFont.h:92:33: warning: ‘LabelBMFont‘ is deprecated (declared at D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/audio/android/../../2d/CCLabelBMFont.h:74) [-Wdeprecated-declarations]
static LabelBMFont * create();
^
[armeabi] Compile thumb : chipmunk_static <= cpArray.c
[armeabi] Compile thumb : chipmunk_static <= cpBB.c
[armeabi] Compile thumb : chipmunk_static <= cpBBTree.c
[armeabi] Compile thumb : chipmunk_static <= cpBody.c
[armeabi] Compile thumb : chipmunk_static <= cpCollision.c
[armeabi] Compile thumb : chipmunk_static <= cpHashSet.c
[armeabi] Compile thumb : chipmunk_static <= cpPolyShape.c
[armeabi] Compile thumb : chipmunk_static <= cpShape.c
[armeabi] Compile thumb : chipmunk_static <= cpSpace.c
[armeabi] Compile thumb : chipmunk_static <= cpSpaceComponent.c
[armeabi] Compile thumb : chipmunk_static <= cpSpaceHash.c
[armeabi] Compile thumb : chipmunk_static <= cpSpaceQuery.c
[armeabi] Compile thumb : chipmunk_static <= cpSpaceStep.c
[armeabi] Compile thumb : chipmunk_static <= cpSpatialIndex.c
[armeabi] Compile thumb : chipmunk_static <= cpSweep1D.c
[armeabi] Compile thumb : chipmunk_static <= cpVect.c
[armeabi] Compile thumb : chipmunk_static <= cpConstraint.c
[armeabi] Compile thumb : chipmunk_static <= cpDampedRotarySpring.c
[armeabi] Compile thumb : chipmunk_static <= cpDampedSpring.c
[armeabi] Compile thumb : chipmunk_static <= cpGearJoint.c
[armeabi] Compile thumb : chipmunk_static <= cpGrooveJoint.c
[armeabi] Compile thumb : chipmunk_static <= cpPinJoint.c
[armeabi] Compile thumb : chipmunk_static <= cpPivotJoint.c
[armeabi] Compile thumb : chipmunk_static <= cpRatchetJoint.c
[armeabi] Compile thumb : chipmunk_static <= cpRotaryLimitJoint.c
[armeabi] Compile thumb : chipmunk_static <= cpSimpleMotor.c
[armeabi] Compile thumb : chipmunk_static <= cpSlideJoint.c
[armeabi] Compile++ thumb: cocos2dxandroid_static <= CCApplication.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= CCCommon.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= CCDevice.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= CCGLView.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= CCFileUtilsAndroid.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= javaactivity.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= DPIJni.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= IMEJni.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= Java_org_cocos2dx_lib_Cocos2dxHelper.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= JniHelper.cpp
[armeabi] Compile++ thumb: cocos2dxandroid_static <= TouchesJni.cpp
[armeabi] Compile thumb : cpufeatures <= cpu-features.c
[armeabi] StaticLibrary : libcocos2d.a
[armeabi] StaticLibrary : libcocosdenshion.a
[armeabi] StaticLibrary : libchipmunk.a
[armeabi] StaticLibrary : libcpufeatures.a
[armeabi] StaticLibrary : libcocos2dandroid.a
[armeabi] SharedLibrary : libcocos2dcpp.so
[armeabi] Install : libcocos2dcpp.so => libs/armeabi/libcocos2dcpp.so
make.exe: Leaving directory `D:/Cocos2d-x/projects/HelloCC/proj.android‘
The Selected NDK toolchain version was 4.8 !
**** Build Finished ****
编译完成之后我们运行项目,右键run as Android Application,在控制台我们会看到这样的信息:
**** Build of configuration Default for project HelloCC ****
python D:/Cocos2d-x/projects/HelloCC/proj.android/build_native.py all
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml
Android NDK: WARNING:D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/./Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static libraries
Android NDK: WARNING:D:\Cocos2d-x\projects\HelloCC\proj.android\../cocos2d/cocos/platform/android/Android.mk:cocos2dxandroid_static: LOCAL_LDLIBS is always ignored for static libraries
make.exe: Entering directory `D:/Cocos2d-x/projects/HelloCC/proj.android‘
[armeabi] Install : libcocos2dcpp.so => libs/armeabi/libcocos2dcpp.so
make.exe: Leaving directory `D:/Cocos2d-x/projects/HelloCC/proj.android‘
The Selected NDK toolchain version was 4.8 !
**** Build Finished ****
最后我们的项目就会成功的跑起来啦:
本篇博客已经很清楚介绍了如何在Eclipse下进行交叉编译,我们可以选择在命令行直接执行build_native.py来对项目进行编译,也可以用本篇博客介绍的方式。运行出我们的hello world,我们就可以愉快的进行Android平台的移植啦。
Cocos2d-x 3.1.1 在Windows下搭建Android开发环境