I can't build build_native.sh

When i build the project many errors appears.

@
jni/…/…/…/cocos2dx/effects/CCGrabber.cpp: In constructor ‘cocos2d::CCGrabber::CCGrabber()’:
jni/…/…/…/cocos2dx/effects/CCGrabber.cpp:46: error: ‘glGenFramebuffersOES’ was not declared in this scope
jni/…/…/…/cocos2dx/effects/CCGrabber.cpp: In member function ’void cocos2d::CCGrabber::grab(cocos2d::CCTexture2D**)‘:
jni/…/…/…/cocos2dx/effects/CCGrabber.cpp:61: error: ’glBindFramebufferOES’ was not declared in this scope
jni/…/…/…/cocos2dx/effects/CCGrabber.cpp:65: error: ‘glFramebufferTexture2DOES’ was not declared in this scope
jni/…/…/…/cocos2dx/effects/CCGrabber.cpp:68: error: ‘glCheckFramebufferStatusOES’ was not declared in this scope
jni/…/…/…/cocos2dx/effects/CCGrabber.cpp: In member function ’void cocos2d::CCGrabber::beforeRender‘:
jni/…/…/…/cocos2dx/effects/CCGrabber.cpp:88: error: ’glBindFramebufferOES’ was not declared in this scope
jni/…/…/…/cocos2dx/effects/CCGrabber.cpp: In member function ’void cocos2d::CCGrabber::afterRender‘:
jni/…/…/…/cocos2dx/effects/CCGrabber.cpp:113: error: ’glBindFramebufferOES’ was not declared in this scope
jni/…/…/…/cocos2dx/effects/CCGrabber.cpp: In destructor ‘virtual cocos2d::CCGrabber::~CCGrabber()’:
jni/…/…/…/cocos2dx/effects/CCGrabber.cpp:127: error: ‘glDeleteFramebuffersOES’ was not declared in this scope
make:**** [obj/local/armeabi/objs-debug/cocos2d/effects/CCGrabber.o] Error 1
@

I’m using ndk-r7 in Lion.

EDIT: Solverd with ndk r5b

Oh, ndk-r7 has been released.
I haven’t tested with it.

Since GL_GLEXT_PROTOTYPES was defined in glplatform.h in previous revision NDK,
In r7, GL_GLEXT_PROTOTYPES was removed from glplatform.h.
So simply add ~~DGL_GLEXT_PROTOTYPES=1 in cocos2dx/Android.mk, like:
LOCAL_CFLAGS :=~~DUSE_FILE32API -DGL_GLEXT_PROTOTYPES=1

and everything should work well.

Thank you, Splash, that helped.

Hi guys,

I came across the same problem on NDK r9. Is this fixed in the beta release?

Here’s my patch that did the trick for me:

diff --git a/libs/cocos2dx/Android.mk b/libs/cocos2dx/Android.mk
index 2c99a76..6e8f12e 100755
--- a/libs/cocos2dx/Android.mk
+++ b/libs/cocos2dx/Android.mk
@@ -125,6 +125,6 @@ LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/platform/third_party/andro
                  -ljpeg

 # define the macro to compile through support/zip_support/ioapi.c                
-LOCAL_CFLAGS := -DUSE_FILE32API
+LOCAL_CFLAGS := -DUSE_FILE32API -DGL_GLEXT_PROTOTYPES

 include $(BUILD_SHARED_LIBRARY)