Quick_Cocos2d_x V3.3 Protobuf Android

早过忘川 提交于 2019-12-06 06:59:15

ios集成protobuf之后,调用pro.android/build_native.sh 生成android工程的时候会出现

jni/../../Classes/AppDelegate.cpp:125: error: undefined reference to 'luaopen_protobuf_c'

clang++: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [obj/local/armeabi/libcocos2dlua.so] Error 1

这时要修改 Android.mk文件,

define copy-pbc-file-name

$(patsubst jni/%,%, $(shell find $(LOCAL_PATH)/../../Classes/pbc $(LOCAL_PATH)/../../Classes/binding/lua -name "*.c"))

endef


LOCAL_SRC_FILES := hellolua/main.cpp \

../../Classes/VisibleRect.cpp \

../../Classes/AppDelegate.cpp \

../../Classes/ConfigParser.cpp \

$(call copy-pbc-file-name)



LOCAL_C_INCLUDES := \

$(LOCAL_PATH)/../../Classes/runtime \

$(LOCAL_PATH)/../../Classes \

$(COCOS2DX_ROOT)/external \

$(COCOS2DX_ROOT)/external/protobuf-lite/src \

$(LOCAL_PATH)/../../Classes/quick-src \

$(LOCAL_PATH)/../../Classes/quick-src/extra \

$(LOCAL_PATH)/../../Classes/pbc

之后成功调用 pro.android/build_native.sh 生成android工程

[armeabi] Install        : libcocos2dlua.so => libs/armeabi/libcocos2dlua.so


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!