问题:在WIN7下使用VS2010使用调试通过一个COCOS2D-X项目后如何移植到ANDROID环境并进而打包安装到真机(或者模拟器)上呢?
STEP 1:配置androID工程生成器
用edit plus之类的编辑器打开 cocos2d-x目录下的 create-androID-project.bat,并进行修改。
注意:上述文件中的几个路径一定要与你自己的路径对应起来!另外,这一步配置成功后,以后再创建其他的工程的androID版本便基本上不再需要修改了。
STEP 2:创建androID工程
这一步是通过运行cocos2d-x目录下的create-androID-project.bat实现的(在windows资源管理器中右键单击此文件,然后选择以管理员身份运行即可)。参考其它的资料,我使用管理员身份运行此文件的(一般运行情况还没有试验)。 然后,屏幕上提示你输入包名和项目名。 注意:如果在2.0.2版本中,如果你输入一个已经存在的项目名,则系统会提示你,已经存在同名,不允许你创建并退出。另外一定要注意,这一步是运行文件 create-androID-project.bat而不是另一个相同主文件名的create-androID-project.sh!!!-----这个文件后面才使用; 否则整个步骤乱套了!!!
我的例子中创建的WIN32项目为eee2,这里创建的ANDROID工程名称为eee21。之后,系统自动运行,并创建项目,其下有三个子文件夹:Classes,proj.androID和Resources。
STEP 3:@H_301_128@导入代码和有关资源
现在, 把你win32项目里的Classes拷贝到当前Classes下。然后把你win32项目里的Resources拷贝到当前Resources 下。
提示1:2.0.2版本与1.x版本中管理资源的方式发生了较大变化,请注意这一点。当然,在高版本中,管理更为方便和科学了。
提示2:直接使用覆盖方式复制粘贴即可。另外,还要想着先把最初系统自动生成的几个可能不再有用的文件删除。
STEP 4:@H_301_128@编辑jni文件夹下的androID.mk等文件
这一步比较复杂,要求你最好深入理解application.mk和androID.mk这两个文件在NDK编程中的位置及详细作用。在此不具体展开介绍了。
因为,我的例子是一个由系统向导自动生成的HELLO WORLD级的程序,所以,一路走下来非常顺利。
我的androID.mk文件修改为如下形式:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODulE := game_shared
#LOCAL_MODulE_filename := libgame
LOCAL_SRC_fileS := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \
$(LOCAL_PATH)/../../../cocos2dx \
$(LOCAL_PATH)/../../../cocos2dx/platform. \
$(LOCAL_PATH)/../../../cocos2dx/include \
$(LOCAL_PATH)/../../../cocosDension/include
LOCAL_WHolE_STATIC_liBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static
include $(BUILD_SHARED_liBRARY)
$(call import-module,CocosDenshion/androID) \
$(call import-module,cocos2dx) \
$(call import-module,extensions)
我的更改有:
1,注释掉了LOCAL_MODulE_filename := libgame这一句。
2,把共享库名字更改为game_shared,对应于eee21.java文件中的下面一句必须作相应的修改:
System.loadlibrary("game_shared");
3,根据我的ANDROID工程所在位置修改了头文件引用部分。
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \
$(LOCAL_PATH)/../../../cocos2dx \
$(LOCAL_PATH)/../../../cocos2dx/platform. \
$(LOCAL_PATH)/../../../cocos2dx/include \
$(LOCAL_PATH)/../../../cocosDension/include
其中, $(LOCAL_PATH)是jni文件夹,于是相对于这一级文件夹,你的cocos2d-x系统的相应的头文件在哪一级文件夹下要明明白白才行。
另外,要注意的是,在最上面一行的\符号的后面直接跟的是一个硬回车字符。如果这个硬回车字符前面还有其他的什么空白符号的话,NDK编译到这个地方就停止了。
STEP 4:@H_301_128@运行build_native.sh脚本文件编译生成so库
根据网络的参考资料,我以系统管理员身份运行cycwin。然后运行你的系统生成的ANDROID工程内proj.androID文件夹下的build_native.sh脚本文件,我的文件位置在:
E:\download2010\cocos2d-x\cocos2d-2.0-x-2.0.2\eee21\proj.androID
一般是先切换到上述文件夹下,然后再运行那个脚本文件,我的命令是:
1. cd /cygdrive/e/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2/eee21/proj.androID
2. ./build_native.sh
输出结果是:
NDK_ROOT = /cygdrive/d/ndkr8
COCOS2DX_ROOT = /cygdrive/e/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2/eee21/pro
j.androID/../..
APP_ROOT = /cygdrive/e/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2/eee21/proj.and
roID/..
APP_ANDROID_ROOT = /cygdrive/e/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2/eee21/
proj.androID
Using prebuilt externals
make: Entering directory `/cygdrive/e/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2
/eee21/proj.androID'
Gdbserver : [arm-linux-androIDeabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Cygwin : Generating dependency file converter script
Compile++ thumb : game_shared <= main.cpp
Compile++ thumb : game_shared <= AppDelegate.cpp
Compile++ thumb : game_shared <= HelloWorldScene.cpp
Prebuilt : libgnustl_static.a <= <NDK>/sources/cxx-stl/gnu-libstdc++/libs/
armeabi/
Compile++ thumb : cocos2dx_static <= CCConfiguration.cpp
Compile++ thumb : cocos2dx_static <= CCDrawingPrimitives.cpp
Compile++ thumb : cocos2dx_static <= CCScheduler.cpp
Compile++ thumb : cocos2dx_static <= CCCamera.cpp
Compile++ thumb : cocos2dx_static <= CCAction.cpp
Compile++ thumb : cocos2dx_static <= CCActionCamera.cpp
Compile++ thumb : cocos2dx_static <= CCActionCatmullRom.cpp
Compile++ thumb : cocos2dx_static <= CCActionEase.cpp
Compile++ thumb : cocos2dx_static <= CCActionGrID.cpp
Compile++ thumb : cocos2dx_static <= CCActionGrID3D.cpp
Compile++ thumb : cocos2dx_static <= CCActionInstant.cpp
Compile++ thumb : cocos2dx_static <= CCActionInterval.cpp
Compile++ thumb : cocos2dx_static <= CCActionManager.cpp
Compile++ thumb : cocos2dx_static <= CCActionPageTurn3D.cpp
Compile++ thumb : cocos2dx_static <= CCActionProgresstimer.cpp
Compile++ thumb : cocos2dx_static <= CCActionTiledGrID.cpp
Compile++ thumb : cocos2dx_static <= CCActionTween.cpp
Compile++ thumb : cocos2dx_static <= CCAtlasNode.cpp
Compile++ thumb : cocos2dx_static <= CCNode.cpp
Compile++ thumb : cocos2dx_static <= CCAffinetransform.cpp
Compile++ thumb : cocos2dx_static <= CCGeometry.cpp
Compile++ thumb : cocos2dx_static <= CCautoreleasePool.cpp
Compile++ thumb : cocos2dx_static <= CCDictionary.cpp
Compile++ thumb : cocos2dx_static <= CCNS.cpp
Compile++ thumb : cocos2dx_static <= CCObject.cpp
Compile++ thumb : cocos2dx_static <= CCSet.cpp
Compile++ thumb : cocos2dx_static <= CCString.cpp
Compile++ thumb : cocos2dx_static <= CCZone.cpp
Compile++ thumb : cocos2dx_static <= CCArray.cpp
Compile++ thumb : cocos2dx_static <= cocos2d.cpp
Compile++ thumb : cocos2dx_static <= CCDirector.cpp
Compile++ thumb : cocos2dx_static <= CCGrabber.cpp
Compile++ thumb : cocos2dx_static <= CCGrID.cpp
Compile thumb : cocos2dx_static <= aabb.c
Compile thumb : cocos2dx_static <= mat3.c
Compile thumb : cocos2dx_static <= mat4.c
Compile thumb : cocos2dx_static <= neon_matrix_impl.c
Compile thumb : cocos2dx_static <= plane.c
Compile thumb : cocos2dx_static <= quaternion.c
E:/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2/eee21/proj.androID/../../cocos2dx/
kazmath/src/quaternion.c: In function 'kmQuaternionAssign':
E:/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2/eee21/proj.androID/../../cocos2dx/
kazmath/src/quaternion.c:478: warning: incompatible implicit declaration of buil
t-in function 'memcpy'
Compile thumb : cocos2dx_static <= ray2.c
Compile thumb : cocos2dx_static <= utility.c
Compile thumb : cocos2dx_static <= vec2.c
Compile thumb : cocos2dx_static <= vec3.c
Compile thumb : cocos2dx_static <= vec4.c
E:/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2/eee21/proj.androID/../../cocos2dx/
kazmath/src/vec4.c: In function 'kmVec4Assign':
E:/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2/eee21/proj.androID/../../cocos2dx/
kazmath/src/vec4.c:150: warning: incompatible implicit declaration of built-in f
unction 'memcpy'
Compile thumb : cocos2dx_static <= mat4stack.c
Compile thumb : cocos2dx_static <= matrix.c
Compile++ thumb : cocos2dx_static <= CCKeypadDelegate.cpp
Compile++ thumb : cocos2dx_static <= CCKeypaddispatcher.cpp
Compile++ thumb : cocos2dx_static <= cclabelAtlas.cpp
Compile++ thumb : cocos2dx_static <= cclabelBMFont.cpp
Compile++ thumb : cocos2dx_static <= cclabelTTF.cpp
Compile++ thumb : cocos2dx_static <= cclayer.cpp
Compile++ thumb : cocos2dx_static <= CCScene.cpp
Compile++ thumb : cocos2dx_static <= CCTransitionPageTurn.cpp
Compile++ thumb : cocos2dx_static <= CCTransition.cpp
Compile++ thumb : cocos2dx_static <= CCTransitionProgress.cpp
Compile++ thumb : cocos2dx_static <= Ccmenu.cpp
Compile++ thumb : cocos2dx_static <= CcmenuItem.cpp
Compile++ thumb : cocos2dx_static <= CCMotionStreak.cpp
Compile++ thumb : cocos2dx_static <= CCProgresstimer.cpp
Compile++ thumb : cocos2dx_static <= CCRenderTexture.cpp
Compile++ thumb : cocos2dx_static <= CCParticleExamples.cpp
Compile++ thumb : cocos2dx_static <= CCParticleSystem.cpp
Compile++ thumb : cocos2dx_static <= CCParticleBatchNode.cpp
Compile++ thumb : cocos2dx_static <= CCParticleSystemQuad.cpp
Compile++ thumb : cocos2dx_static <= CCSAXParser.cpp
Compile++ thumb : cocos2dx_static <= CCThread.cpp
Compile++ thumb : cocos2dx_static <= platform.cpp
Compile++ thumb : cocos2dx_static <= CCEGLVIEwProtocol.cpp
Compile++ thumb : cocos2dx_static <= CCEGLVIEw.cpp
Compile++ thumb : cocos2dx_static <= CCAccelerometer.cpp
Compile++ thumb : cocos2dx_static <= CCApplication.cpp
Compile++ thumb : cocos2dx_static <= CCCommon.cpp
Compile++ thumb : cocos2dx_static <= CCfileUtils.cpp
Compile++ thumb : cocos2dx_static <= CCImage.cpp
Compile++ thumb : cocos2dx_static <= EditBoxJni.cpp
Compile++ thumb : cocos2dx_static <= JniHelper.cpp
Compile++ thumb : cocos2dx_static <= IMEJni.cpp
Compile++ thumb : cocos2dx_static <= MessageJni.cpp
Compile++ thumb : cocos2dx_static <= SensorJni.cpp
Compile++ thumb : cocos2dx_static <= SystemInfoJni.cpp
Compile++ thumb : cocos2dx_static <= touchesJni.cpp
Compile++ thumb : cocos2dx_static <= ccScriptSupport.cpp
Compile++ thumb : cocos2dx_static <= ccShaders.cpp
Compile++ thumb : cocos2dx_static <= CCGLProgram.cpp
Compile++ thumb : cocos2dx_static <= ccGLStateCache.cpp
Compile++ thumb : cocos2dx_static <= CCshadercache.cpp
Compile++ thumb : cocos2dx_static <= CCAnimation.cpp
Compile++ thumb : cocos2dx_static <= CCAnimationCache.cpp
Compile++ thumb : cocos2dx_static <= CCSprite.cpp
Compile++ thumb : cocos2dx_static <= CCSpriteBatchNode.cpp
Compile++ thumb : cocos2dx_static <= CCSpriteFrame.cpp
Compile++ thumb : cocos2dx_static <= CCSpriteFrameCache.cpp
Compile++ thumb : cocos2dx_static <= CCNotificationCenter.cpp
Compile++ thumb : cocos2dx_static <= CCProfiling.cpp
Compile++ thumb : cocos2dx_static <= CCPointExtension.cpp
Compile++ thumb : cocos2dx_static <= transformUtils.cpp
Compile++ thumb : cocos2dx_static <= CCUserDefault.cpp
Compile++ thumb : cocos2dx_static <= base64.cpp
Compile++ thumb : cocos2dx_static <= ccUtils.cpp
Compile++ thumb : cocos2dx_static <= CCVertex.cpp
Compile++ thumb : cocos2dx_static <= ccCArray.cpp
Compile++ thumb : cocos2dx_static <= Tgalib.cpp
Compile++ thumb : cocos2dx_static <= ZipUtils.cpp
Compile++ thumb : cocos2dx_static <= ioAPI.cpp
Compile++ thumb : cocos2dx_static <= unzip.cpp
Compile++ thumb : cocos2dx_static <= CCIMEdispatcher.cpp
Compile++ thumb : cocos2dx_static <= CCTextFIEldTTF.cpp
Compile++ thumb : cocos2dx_static <= CCTexture2D.cpp
Compile++ thumb : cocos2dx_static <= CCTextureAtlas.cpp
Compile++ thumb : cocos2dx_static <= CCTextureCache.cpp
Compile++ thumb : cocos2dx_static <= CCTexturePVR.cpp
Compile++ thumb : cocos2dx_static <= CCParallaxNode.cpp
Compile++ thumb : cocos2dx_static <= CCTMXLayer.cpp
Compile++ thumb : cocos2dx_static <= CCTMXObjectGroup.cpp
Compile++ thumb : cocos2dx_static <= CCTMXTiledMap.cpp
Compile++ thumb : cocos2dx_static <= CCTMXXMLParser.cpp
Compile++ thumb : cocos2dx_static <= CCTileMapAtlas.cpp
Compile++ thumb : cocos2dx_static <= CCtouchdispatcher.cpp
Compile++ thumb : cocos2dx_static <= CCtouchHandler.cpp
Compile++ thumb : cocos2dx_static <= CCtouch.cpp
Prebuilt : png.a <= /cygdrive/e/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2
/eee21/proj.androID/../../cocos2dx/platform/third_party/androID/prebuilt/libpng/
libs/armeabi/
Prebuilt : jpeg.a <= /cygdrive/e/download2010/cocos2d-x/cocos2d-2.0-x-2.0.
2/eee21/proj.androID/../../cocos2dx/platform/third_party/androID/prebuilt/libjpe
g/libs/armeabi/
Prebuilt : xml2.a <= /cygdrive/e/download2010/cocos2d-x/cocos2d-2.0-x-2.0.
2/eee21/proj.androID/../../cocos2dx/platform/third_party/androID/prebuilt/libxml
2/libs/armeabi/
Prebuilt : tiff.a <= /cygdrive/e/download2010/cocos2d-x/cocos2d-2.0-x-2.0.
2/eee21/proj.androID/../../cocos2dx/platform/third_party/androID/prebuilt/libtif
f/libs/armeabi/
Staticlibrary : libcocos2d.a
Compile++ thumb : cocosdenshion_static <= SimpleAudioEngine.cpp
Compile++ thumb : cocosdenshion_static <= SimpleAudioEngineJni.cpp
Compile++ thumb : cocosdenshion_static <= OpenSLEngine.cpp
E:/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2/eee21/proj.androID/../../CocosDens
hion/androID/opensl/OpenSLEngine.cpp: In function 'bool initAudioPlayer(AudioPla
yer*,const char*)':
E:/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2/eee21/proj.androID/../../CocosDens
hion/androID/opensl/OpenSLEngine.cpp:292: warning: extended initializer Lists on
ly available with -std=c++0x or -std=gnu++0x
E:/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2/eee21/proj.androID/../../CocosDens
hion/androID/opensl/OpenSLEngine.cpp:292: warning: extended initializer Lists on
ly available with -std=c++0x or -std=gnu++0x
Compile++ thumb : cocosdenshion_static <= SimpleAudioEngineOpenSL.cpp
Staticlibrary : libcocosdenshion.a
Compile++ thumb : cocos_extension_static <= CCBfileLoader.cpp
Compile++ thumb : cocos_extension_static <= CCBReader.cpp
E:/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2/eee21/proj.androID/../../extension
s/CCBReader/CCBReader.cpp:141:52: warning: multi-character character constant
Compile++ thumb : cocos_extension_static <= CCControlbuttonLoader.cpp
Compile++ thumb : cocos_extension_static <= CCControlLoader.cpp
Compile++ thumb : cocos_extension_static <= cclabelBMFontLoader.cpp
Compile++ thumb : cocos_extension_static <= cclabelTTFLoader.cpp
Compile++ thumb : cocos_extension_static <= cclayercolorLoader.cpp
Compile++ thumb : cocos_extension_static <= cclayerGradIEntLoader.cpp
Compile++ thumb : cocos_extension_static <= cclayerLoader.cpp
Compile++ thumb : cocos_extension_static <= CcmenuItemImageLoader.cpp
Compile++ thumb : cocos_extension_static <= CcmenuItemloader.cpp
Compile++ thumb : cocos_extension_static <= CCNodeLoader.cpp
Compile++ thumb : cocos_extension_static <= CCNodeLoaderlibrary.cpp
Compile++ thumb : cocos_extension_static <= CCParticleSystemQuadLoader.cpp
Compile++ thumb : cocos_extension_static <= CCScale9SpriteLoader.cpp
Compile++ thumb : cocos_extension_static <= CCScrollVIEwLoader.cpp
Compile++ thumb : cocos_extension_static <= CCSpriteLoader.cpp
Compile++ thumb : cocos_extension_static <= CCControl.cpp
Compile++ thumb : cocos_extension_static <= CCControlbutton.cpp
Compile++ thumb : cocos_extension_static <= CCControlColourPicker.cpp
Compile++ thumb : cocos_extension_static <= CCControlHuePicker.cpp
Compile++ thumb : cocos_extension_static <= CCControlSaturationBrightnessPicker
.cpp
Compile++ thumb : cocos_extension_static <= CCControlSlIDer.cpp
Compile++ thumb : cocos_extension_static <= CCControlSwitch.cpp
Compile++ thumb : cocos_extension_static <= CCControlUtils.cpp
Compile++ thumb : cocos_extension_static <= CCInvocation.cpp
Compile++ thumb : cocos_extension_static <= CcmenuPassive.cpp
Compile++ thumb : cocos_extension_static <= CCScale9Sprite.cpp
Compile++ thumb : cocos_extension_static <= CCSpacer.cpp
Compile++ thumb : cocos_extension_static <= CCScrollVIEw.cpp
Compile++ thumb : cocos_extension_static <= CCEditBox.cpp
Compile++ thumb : cocos_extension_static <= CCEditBoxImplAndroID.cpp
Compile++ thumb : cocos_extension_static <= httpClIEnt.cpp
Prebuilt : curl.a <= /cygdrive/e/download2010/cocos2d-x/cocos2d-2.0-x-2.0.
2/eee21/proj.androID/../../cocos2dx/platform/third_party/androID/prebuilt/libcur
l/libs/armeabi/
Staticlibrary : libextension.a
Sharedlibrary : libgame_shared.so
Install : libgame_shared.so => libs/armeabi/libgame_shared.so
make: Leaving directory `/cygdrive/e/download2010/cocos2d-x/cocos2d-2.0-x-2.0.2/
eee21/proj.androID'
administrator@Xianzhong-PC /cygdrive/e/download2010/cocos2d-x/cocos2d-2.0-x-2.0.
2/eee21/proj.androID
注意:其中有几处警告性提示--这个以后再学习。总之,顺利生成了libs文件夹下的.so文件。
STEP 5:@H_301_128@使用ECliPSE再编译并打包到真机测试
启动Eclipse,使用file -> New -> Project...在随后的"New Project"对话框中选择AndroID->AndroID project from existing code,如下所示:
随后出现导入工程对话框,类似(来自于另一个实例)下图所示:
导入(浏览文件夹时选择 到proj.androID这一层)成功,然后就是编译执行了。
cocos2d-x作者推荐用上面的.sh方式编译生成.so库文件,然后再用eclipse编译成.apk文件。 |
注意:在导入成功后,我没有作任何修改,先使用重新编译了一下工程(在工程上面单击右键-构建工程),然后按Ctrl+F11运行。
下图给出了在我的真机SamSung I9100上运行的结果快照:
补充1:@H_301_128@开发环境
我的开发环境是:
windows 7
ECliPSE Indigo Service Release 2
CYGWIN
NDK 8
vs2010
最新版本的cocos2d-x 2.0.2(上述 *** 作同样适用于到当前最新版本2.1Beta3)。
补充2:@H_301_128@在2.1Beta3下导入到Eclipse的一个细节
我喜欢跟踪使用最新的COCOS2D-X的开发环境。可是,在目前最新的2.1Beta3 SDK对应的WIN32工程导入到Eclipse中时,在导入结束,工程左边显示一个大大的红色的感叹号。进入到工程属性窗口中发现,工程引入了另外一个工程Java,如下图所示:
此时,一般需要重新把系统自动导入的java工程构建一下。然后,再把你的游戏工程再构建一下即可。
另外:在cocos2d-2.1beta3-x-2.1.1版本中也有与上面一样的规律,我现在(2013.2.6)刚刚使用过,OK!
补充3:@H_301_128@在2.1Beta3下运行build_native.sh生成的src文件夹下的java文件
这个JAVA文件的内容也简单多了,我在最近使用的小型试验型工程中相应的文件内容如下:
/****************************************************************************
copyright (c) 2010-2012 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted,free of charge,to any person obtaining a copy
of this software and associated documentation files (the "Software"),to deal
in the Software without restriction,including without limitation the rights
to use,copy,modify,merge,publish,distribute,sublicense,and/or sell
copIEs of the Software,and to permit persons to whom the Software is
furnished to do so,subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copIEs or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS",WITHOUT WARRANTY OF ANY KIND,EXPRESS OR
IMPLIED,INCLUDING BUT NOT liMITED TO THE WARRANTIES OF MERCHANTABIliTY,
fitness FOR A PARTIculaR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR copYRIGHT HolDERS BE liABLE FOR ANY CLaim,damAGES OR OTHER
liABIliTY,WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE,ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEAliNGS IN
THE SOFTWARE.
****************************************************************************/
package org.zxz.HellosqliteA;
import org.cocos2dx.lib.Cocos2dxActivity;
import androID.os.Bundle;
public class HellosqliteA extends Cocos2dxActivity{
protected voID onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
}
static {
System.loadlibrary("game_shared");
}
}
不用作任何修改即可。
最后,文件夹proj.androID\jni\hellocpp下系统自动生成的main.cpp头文件引用中的下面一行一般要去掉的(根据你的情况吧):
#include "HelloworldScene.h"
无标题.jpg
无标题.jpg
无标题.jpg
捕获.JPG
总结以上是内存溢出为你收集整理的Cocos2d-x学习笔记(3:将VS2010下cocos2d-x 2.0.2 win32工程移植到android环境)全部内容,希望文章能够帮你解决Cocos2d-x学习笔记(3:将VS2010下cocos2d-x 2.0.2 win32工程移植到android环境)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)