Android compilation: undefined reference to `glDisable'

Hi,

I have been following the tutorial at http://gameit.ro/2011/08/creating-an-iphone-and-android-cocos2d-x-hybrid-project/ about creating an hybrid iphone-android project. All is ok, but when I compile the project for Android, it fail because of:

HelloWorldScene.cpp:(.text._ZN10HelloWorld4drawEv+0xa): undefined reference to `glDisable’
HelloWorldScene.cpp:(.text._ZN10HelloWorld4drawEv+0x12): undefined reference to `glDisableClientState’
HelloWorldScene.cpp:(.text._ZN10HelloWorld4drawEv+0x1a): undefined reference to `glDisableClientState’
HelloWorldScene.cpp:(.text._ZN10HelloWorld4drawEv+0x22): undefined reference to `glEnable’
HelloWorldScene.cpp:(.text._ZN10HelloWorld4drawEv+0x2a): undefined reference to `glEnableClientState’
HelloWorldScene.cpp:(.text._ZN10HelloWorld4drawEv+0x32): undefined reference to `glEnableClientState’

Any ideas?
Tx,
M.

Edit: my answer was completely bogus so I’m removing it for now until I figure out what the real issue is.

What’s the sdk & ndk version are you using? If you’re using ndk r7, or sdk 4.0, these documents may be helpful
* [[Some cautions of Android 4.0]]
* [[Build project with ndk-r7]]

I just had the same problem.

In your android/jni/helloworld/Android.mk

add -lGLESv1_CM to LOCAL_LDLIBS

That fixed it for me.

Goodluck dude

I have the same problom.
My android.md:

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/Tower.cpp …/…/Classes/BattleScene.cpp …/…/Classes/WayPoint.cpp

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

LOCAL_LDLIBS := ~~lGLESv2 ~~lEGL ~~llog ~~lz

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static

include $(BUILD_SHARED_LIBRARY)

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