3

我已经在 cocos2d-x 中下载了一个项目的源代码。

我正在使用Hello World./build_native.sh示例中的示例,它肯定可以工作。

编译时再次出现此错误:

Gdbserver      : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
Gdbsetup       : libs/armeabi/gdb.setup
Compile++ thumb  : cocos2d <= CCGrabber.cpp
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In constructor 'cocos2d::CCGrabber::CCGrabber()':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:46:32: error: 'glGenFramebuffersOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In member function 'void cocos2d::CCGrabber::grab(cocos2d::CCTexture2D*)':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:61:47: error: 'glBindFramebufferOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:65:26: error: 'glFramebufferTexture2DOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:68:63: error: 'glCheckFramebufferStatusOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In member function 'void cocos2d::CCGrabber::beforeRender(cocos2d::CCTexture2D*)':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:88:47: error: 'glBindFramebufferOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In member function 'void cocos2d::CCGrabber::afterRender(cocos2d::CCTexture2D*)':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:113:50: error: 'glBindFramebufferOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In destructor 'virtual cocos2d::CCGrabber::~CCGrabber()':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:127:35: error: 'glDeleteFramebuffersOES' was not declared in this scope

我搜索并找到了这个解决方案。但这对我不起作用。我仍然遇到同样的错误。也许在 ndk-r8 中它是不同的,而解决方案是针对 ndk-r7 的。

有什么帮助吗?

4

1 回答 1

0

你的android sdk版本必须大于2.2。因为从2.2开始,android开始支持opengl es 2.0,而cocos2d-x 2.0使用opengles 2.0渲染

于 2013-04-26T13:02:36.903 回答