help!When I used GLESDebugDraw the compile is fail.

I include the #include “GLES-Render.h” and add (GLES-Render.cpp) in my project fold.But if I used debugDraw = new GLESDebugDraw( PTM_RATIO ),the compile is fail.


webqq_app.gif (68.4 KB)

I am also getting the same Error, when i try to compile for android. Works well on xcode simulator. Worked fine on both android and ios platforms without GLES-Render(debugdraw).

/Users/chandrashekar/Desktop/Android/androidndk/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/…/lib/gcc/arm-linux-androideabi/4.6/…/…/…/…/arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs-debug/game_shared///Classes/HelloWorldScene.o: in function HelloWorld::initPhysics():jni/…/…/Classes/HelloWorldScene.cpp:106: error: undefined reference to ‘GLESDebugDraw::GLESDebugDraw(float)’
collect2: ld returned 1 exit status
make: * [obj/local/armeabi/libgame.so] Error 1
make: Leaving directory `/Users/chandrashekar/Desktop/WORKPLACE/HYBRID/Candy/Candy/android’

Atlast i got it working we have to add the path of GLES-Render.cpp in android/jni/android.mk file. Infact which ever new class/.cpp file you add into your project you have to specify in the .mk file. For further information refer to
http://www.cocos2d-x.org/boards/6/topics/5321

Here is my android.mk file

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := game_shared

LOCAL_MODULE_FILENAME := libgame

LOCAL_SRC_FILES := hellocpp/main.cpp …/…/Classes/AppDelegate.cpp …/…/Classes/HelloWorldScene.cpp …/…/Classes/GLES-Render.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/…/…/Classes $(LOCAL_PATH)/…/…/libs/Box2d

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static box2d_static

include $(BUILD_SHARED_LIBRARY)

$(call import-module,CocosDenshion/android) $(call import-module,cocos2dx) $(call import-module,extensions) $(call import-module,Box2D)