Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » glGetStringi and GL_NUM_EXTENSIONS Errors on Build

This thread is locked; no one can reply to it. rss feed Print
glGetStringi and GL_NUM_EXTENSIONS Errors on Build
ted_gress
Member #14,404
June 2012

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/ask.com'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:

#SelectExpand
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!!!

-Ted

TwilightRaven Games

billyquith
Member #13,534
September 2011

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.

ted_gress
Member #14,404
June 2012

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

Thanks

(EDIT)

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..

TwilightRaven Games

Trent Gamblin
Member #261
April 2000
avatar

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.

ted_gress
Member #14,404
June 2012

Trent:

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?

TwilightRaven Games

Trent Gamblin
Member #261
April 2000
avatar

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.

ted_gress
Member #14,404
June 2012

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.

-Ted

TwilightRaven Games

Thomas Fjellstrom
Member #476
June 2000
avatar

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

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

ted_gress
Member #14,404
June 2012

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

This is my cmake line:

cmake ../ -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-iphone.cmake
-DWANT_FRAMEWORKS=1 -DSHARED=0 -G Xcode

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??

TwilightRaven Games

Go to: