How to solve problems with and android-ndk-r7 on cocos2d-x

I’ve upgrade from android-ndk r6 to r7 today and solved some problems I’ve found with awk.

After that I performed a full compilation on cocos2d-x’s HelloWorld to be sure everything else was ok.

I got an unpleasant surprise: it wasn’t.

The following errors show up:

After some research I found out the reason and the solution to the problem.

The reason:

In the previous releases of android-ndk GL_GLEXT_PROTOTYPES was defined in glplatform.h.
In r7, GL_GLEXT_PROTOTYPES was removed from glplatform.h.

The solution:

add -DGL_GLEXT_PROTOTYPES=1 in <PATH_TO_COCOS2DX>/cocos2dx/, like:


Please, try my games.

Disclaimer: I found the solution for this problem here. All kudos go to Splash Huang.

7 thoughts on “How to solve problems with and android-ndk-r7 on cocos2d-x”

  1. See i had guessed that and lie an idiot i was trying to define  GL_GLEXT_PROTOTYPES din code and not pass to the compiler at build time, i know better. Thanks for showing me the error of my ways. 

Leave a Reply

Your email address will not be published. Required fields are marked *