quick cocos2dx lua 环境、问题、记录
Sublime Text无法跳转在工程目录里的文件。右击目录选择Rebuild user Definition
eclipse无法安装ldt 。问题原因:Preferences-General-Network Connection设置成Manual,INstalling Software会出现网络错误。应改为为Direct
vs2012运行 cannot open scripts/main.lua 配置:配置属性-调试-命令参数 添加:-quick $(QUICK_COCOS2DX_ROOT) -workdir $(ProjectDir)/../ -landscape
必须在主线程里调用CCLuaStack executeFunctionByHandler等实现c++调用lua,否则可能出现问题
android.mk文件配置:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := game_shared LOCAL_MODULE_FILENAME := libgame #LOCAL_SRC_FILES := hellocpp/main.cpp \ # ../../sources/Extensions/encodeDecode.cpp \ # ../../sources/Extensions/CCSocket.cpp \ # ../../sources/MyLuaExtensions.cpp \ # ../../sources/AppDelegate.cpp #LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../sources # 配置自己的源文件目录和源文件后缀名 MY_FILES_PATH := $(LOCAL_PATH) \ $(LOCAL_PATH)/../../sources MY_FILES_SUFFIX := %.cpp %.c %.cc # 递归遍历目录下的所有的文件 rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)) # 获取相应的源文件 MY_ALL_FILES := $(foreach src_path,$(MY_FILES_PATH), $(call rwildcard,$(src_path),*.*) ) MY_ALL_FILES := $(MY_ALL_FILES:$(MY_CPP_PATH)/./%=$(MY_CPP_PATH)%) MY_SRC_LIST := $(filter $(MY_FILES_SUFFIX),$(MY_ALL_FILES)) MY_SRC_LIST := $(MY_SRC_LIST:$(LOCAL_PATH)/%=%) # 去除字串的重复单词 define uniq = $(eval seen :=) $(foreach _,$1,$(if $(filter $_,${seen}),,$(eval seen += $_))) ${seen} endef # 递归遍历获取所有目录 MY_ALL_DIRS := $(dir $(foreach src_path,$(MY_FILES_PATH), $(call rwildcard,$(src_path),*/) ) ) MY_ALL_DIRS := $(call uniq,$(MY_ALL_DIRS)) # 赋值给NDK编译系统 LOCAL_SRC_FILES := $(MY_SRC_LIST) LOCAL_C_INCLUDES := $(MY_ALL_DIRS) LOCAL_CFLAGS += -D__GXX_EXPERIMENTAL_CXX0X__ -std=gnu++11 -Wno-psabi -DCC_LUA_ENGINE_ENABLED=1 $(ANDROID_COCOS2D_BUILD_FLAGS) LOCAL_WHOLE_STATIC_LIBRARIES := quickcocos2dx include $(BUILD_SHARED_LIBRARY) $(call import-module,lib/proj.android)