cocos2dx3.0-编译安卓的一些问题

前端之家收集整理的这篇文章主要介绍了cocos2dx3.0-编译安卓的一些问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

如何Android.mk自己去寻找Classes下的.cpp文件

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_CPPFLAGS += -fexceptions

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

define walk
	$(wildcard $(1)) $(foreach e,$(wildcard $(1)/*),$(call walk,$(e)))
endef

ALLFILES = $(call walk,$(LOCAL_PATH)/../../Classes)

FILE_LIST := hellocpp/main.cpp 
FILE_LIST += $(filter %.cpp,$(ALLFILES))

FILE_INCLUDES := $(shell find $(LOCAL_PATH)/../../Classes -type d)

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



include $(BUILD_SHARED_LIBRARY)

$(call import-module,2d)
$(call import-module,audio/android)
$(call import-module,Box2D)

关于添加extensions编译时找不到文件的情况

在导入cocos-ext.h时不能写成
#include "cocos-ext.h"
而是要写成
#include "extensions/cocos-ext.h"
原文链接:https://www.f2er.com/cocos2dx/345799.html

猜你在找的Cocos2d-x相关文章