glGetStringi and GL_NUM_EXTENSIONS Errors on Build

Hi everyone,

I'm trying to build the iOS allegro frameworks so I can port my allegro game over to iPhone. However, I'm having trouble building the allegro (frameworks) libraries. The issue occurs when I'm calling xcodebuild on the ALLEGRO xcode project in the build folder.

It cannot find glGetStringi() or the constant GL_NUM_EXTENSIONS. I've googled/yahooed/'d them about a billion times and I can't figure out where these identifiers reside. So, basically, I can't compile until I find out what dependencies I'm missing. The error is below:

1 2... 3 4 5iOS/allegro/src/opengl/extensions.c:214:18: error: use of undeclared identifier 'GL_NUM_EXTENSIONS' 6 glGetIntegerv(GL_NUM_EXTENSIONS, &n); 7 ^ 8/Users/waltergress/Desktop/iPhone iOS/allegro/src/opengl/extensions.c:216:14: warning: implicit declaration of function 'glGetStringi' is invalid in C99 [-Wimplicit-function-declaration] 9 name = glGetStringi(GL_EXTENSIONS, i); 10 ^ 11/Users/waltergress/Desktop/iPhone iOS/allegro/src/opengl/extensions.c:216:12: warning: incompatible integer to pointer conversion assigning to 'const GLubyte *' (aka 'const unsigned char *') from 'int'; 12 name = glGetStringi(GL_EXTENSIONS, i); 13 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 14/Users/waltergress/Desktop/iPhone iOS/allegro/src/opengl/extensions.c:434:8: warning: unused variable 'v' [-Wunused-variable] 15 int v = al_get_opengl_version(); 16 ^ 17/Users/waltergress/Desktop/iPhone iOS/allegro/src/opengl/extensions.c:768:28: error: no member named 'GetStringi' in 'struct ALLEGRO_OGL_EXT_API' 18 glGetStringi = ext_api->GetStringi; 19 ~~~~~~~ ^ 203 warnings and 2 errors generated. 21 22...

Any help would be greatly appreciated!!!



May be useful? Build from git. My blog.

Have you included the iPhone cmake toolchain as in instructions in above links?

I normally build Allegro as static libraries as I think everything has to be statically linked on iOS. Try static libraries and see if you get the problem. It is easier anyway.


Yeah I've included the iPhone toolchain in cmake. I'll give your static library idea a try and report back.



I tried going through everything, using your instructions and I'm still getting
the same linker error for the GL functions getStringi and the constant GL_NUM_EXTENSIONS..

thanks for the help though..

Trent Gamblin

Those are compile errors not link errors. A few tips that might help ???

1) Use the latest git version of 5.1
2) Make sure ALLEGRO_CFG_OPENGLES is defined in your alplatf.h
3) Compile with Xcode not Xcodebuild. CMake doesn't fully support iOS building so some things have to be tweaked within Xcode.

NOTE: I just did a full build with all of the addons by manually creating the Xcode project and got it to build without error.



Right, sorry. I don't do a lot of work with XCode and couldn't tell whether they were linker errors or compile.

ALLEGRO_CFG_OPENGLES is NOT defined in my alplatf.h
So I am assuming that is the problem. Is there a way to remedy this?

Trent Gamblin

What version of Allegro are you using? If you're up to date and start a clean build directory, using the Toolchain file, it should be set. To quickly test it out just #define ALLEGRO_CFG_OPENGLES 1 in alplatf.h.


Same issues still present.

I added CFG_OPENGLES 1 to alplatf.h but it didn't make a difference. In fact, I rebuilt the whole directory and tried it, still no luck.
The code is the newest branch off of the svn.


Thomas Fjellstrom

Are you sure you actually configured the build system to build for iOS rather than OSX?


I think so.....this is odd.

This is my cmake line:

cmake ../ -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-iphone.cmake

And after that, I configure the XCode Project, changing these values:

* Base SDK (iOS 6.0)
* Architectures (armv7, armv7s)
* Code Signing Identity (iPhone Developer)
* Targeted Device Family
* Supported Platforms: iOS

Is there anything I'm missing??

Thread #611728. Printed from