标签:引擎 .cpp targe sse cal cost name sdk target
准备工作
你仅仅要依照上一篇的 cocos2d-x 3.0 final 环境搭建 完毕就能够了
1.编辑proj.android\jni\Android.mk,更改内容例如以下
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos2dcpp_shared LOCAL_MODULE_FILENAME := libcocos2dcpp # 遍历文件夹及子文件夹的函数 define walk $(wildcard $(1)) $(foreach e, $(wildcard $(1)/*), $(call walk, $(e))) endef # 遍历Classes文件夹 ALLFILES = $(call walk, $(LOCAL_PATH)/../../Classes) FILE_LIST := hellocpp/main.cpp # 从全部文件里提取出全部.cpp文件 FILE_LIST += $(filter %.cpp, $(ALLFILES)) LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%) LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static #假设使用的是chipmunk引擎须要加上 chipmunk_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static #因为使用了扩展,所以加上 LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static include $(BUILD_SHARED_LIBRARY) $(call import-module,2d) $(call import-module,audio/android) $(call import-module,Box2D)#同上 $(call import-module,extensions)#同上 $(call import-module,editor-support/cocosbuilder) $(call import-module,editor-support/cocostudio) $(call import-module,network)
假设你使用了 #include "cocos-ext.h" 头文件的话,在引入的位置改动为
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #include "extensions/cocos-ext.h" #else #include "cocos-ext.h" #endif
android:screenOrientation="portrait"
3.编译完毕后,打开eclispe ,选择 文件->导入,导入你的项目文件夹下的cocos2d\cocos\2d\platform\android\java,导入,这个是引用libcocos2dx项目,他的属性是库,导入后不要动
4.选择文件->导入,这次是导入你的project下的proj.android的项目,项目导入后会自己主动连接libcocos2dx库,导入后直接执行,OK
cocos2d-x 3.0 final 移植 android
标签:引擎 .cpp targe sse cal cost name sdk target
原文地址:http://www.cnblogs.com/zhchoutai/p/6854833.html