aajiwani / EasyNDK-for-cocos2dx

NDK is always a problem. Writing such a code that can become a breeze in connecting with other platforms is always a problem when working with cocos2dx. This repo is a step made forward to make this pain a simple step.
MIT License
171 stars 107 forks source link

how to integrate easyndk to cocos2d-x Android.mk? #10

Open kyo9999 opened 10 years ago

kyo9999 commented 10 years ago

how to integrate easyndk to cocos2d-x 3.0 Android.mk?

  1. Android.mk add ../../Classes/Game/Foundation_diy/EasyNDK/jansson/dump.c \ ../../Classes/Game/Foundation_diy/EasyNDK/jansson/error.c \ ../../Classes/Game/Foundation_diy/EasyNDK/jansson/hashtable.c \ ../../Classes/Game/Foundation_diy/EasyNDK/jansson/load.c \ ../../Classes/Game/Foundation_diy/EasyNDK/jansson/memory.c \ ../../Classes/Game/Foundation_diy/EasyNDK/jansson/pack_unpack.c \ ../../Classes/Game/Foundation_diy/EasyNDK/jansson/strbuffer.c \ ../../Classes/Game/Foundation_diy/EasyNDK/jansson/strconv.c \ ../../Classes/Game/Foundation_diy/EasyNDK/jansson/utf.c \ ../../Classes/Game/Foundation_diy/EasyNDK/jansson/value.c \
  2. compile error Compile++ thumb : cocos2dcpp_shared <= NDKHelper.cpp In file included from jni/../../Classes/Game/Foundation_diy/EasyNDK/NDKHelper/NDKHelper.cpp:9:0: jni/../../Classes/Game/Foundation_diy/EasyNDK/NDKHelper/NDKHelper.h:16:21: fatal error: jansson.h: No such file or directory
  3. add like instruction: LOCAL_SRC_FILES := hellocpp/main.cpp \ ../../Classes/AppDelegate.cpp \ ../../Classes/HelloWorldScene.cpp \ ../../Classes/jansson/dump.c \ ../../Classes/jansson/error.c \ ../../Classes/jansson/hashtable.c \ ../../Classes/jansson/load.c \ ../../Classes/jansson/memory.c \ ../../Classes/jansson/pack_unpack.c \ ../../Classes/jansson/strbuffer.c \ ../../Classes/jansson/strconv.c \ ../../Classes/jansson/utf.c \ ../../Classes/jansson/value.c \ ../../Classes/NDKHelper/NDKCallbackNode.cpp \ ../../Classes/NDKHelper/NDKHelper.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \ $(LOCAL_PATH)/../../Classes/NDKHelper \ $(LOCAL_PATH)/../../Classes/jansson \

  1. compile error jni/../../Classes/Game/Foundation_diy/EasyNDK/NDKHelper/NDKHelper.cpp: At global scope: jni/../../Classes/Game/Foundation_diy/EasyNDK/NDKHelper/NDKHelper.cpp:255:73: warning: 'CCObject' is deprecated (declared at /Users/xx/Documents/cocos2d-x-3.0alpha0-pre/projects/xxx/proj.android/../../../cocos2dx/cocoa/CCObject.h:64) [-Wdeprecated-declarations] void SendMessageWithParams(string methodName, CCObject* methodParams) ^ cc1plus: some warnings being treated as errors make: * [obj/local/armeabi/objs/cocos2dcpp_shared//**/Classes/Game/Foundation_diy/EasyNDK/NDKHelper/NDKHelper.o] Error 1 make: Leaving directory `/Users/xx/Documents/cocos2d-x-3.0alpha0-pre/projects/xxx/proj.android'