升级以前的项目到3.17,然后编译遇到这个问题。
/Users/luoxiaopeng/Projects/bigb2075/cocos2d/cocos/2d/CCActionProgressTimer.cpp:78: error: undefined reference to 'cocos2d::ui::LoadingBar::getPercent() const'
/Users/luoxiaopeng/Projects/bigb2075/cocos2d/cocos/2d/CCActionProgressTimer.cpp:82: error: undefined reference to 'typeinfo for cocos2d::ui::LoadingBar'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
贴上我的Android.mk
start
define all-files-under
$(patsubst ./%,%, \
$(shell cd $(LOCAL_PATH) ; \
find $(1) -name "$(2)" -and -not -name ".*") \
)
endef
define all-cpp-files-under
$(call all-files-under,$(1),*.cpp)
endef
define all-c-files-under
$(call all-files-under,$(1),*.c)
endef
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := MyGame_shared
LOCAL_MODULE_FILENAME := libMyGame
FILE_INCLUDES := $(shell find $(LOCAL_PATH)/../../../Classes -type d)
$(call import-add-path,$(LOCAL_PATH)/../../../cocos2d)
$(call import-add-path,$(LOCAL_PATH)/../../../cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/../../../cocos2d/cocos)
$(call import-add-path,$(LOCAL_PATH)/../../../cocos2d/cocos/ui)
LOCAL_SRC_FILES := $(call all-cpp-files-under,../../../Classes) \
$(call all-c-files-under,../../../Classes) \
$(call all-cpp-files-under,.) \
LOCAL_C_INCLUDES := $(shell find $(LOCAL_PATH)/../../../Classes -type d)
LOCAL_STATIC_LIBRARIES := cc_static
LOCAL_STATIC_LIBRARIES += cocos_ui_static
LOCAL_STATIC_LIBRARIES += cocos_extension_static
include $(BUILD_SHARED_LIBRARY)
$(call import-module, cocos)
$(call import-module, ui)
end
我已经引用了 ui module 为什么还是找不到? 谢谢各位辛苦工作的程序员