glGetStringi and GL_NUM_EXTENSIONS Errors on Build
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:
extensions.c:214:18: error: use of undeclared identifier 'GL_NUM_EXTENSIONS'
extensions.c:216:14: warning: implicit declaration of function 'glGetStringi'
is invalid in C99 [-
extensions.c:216:12: warning: incompatible integer to pointer conversion assigning to 'const GLubyte *' (
aka 'const unsigned char *')
extensions.c:434:8: warning: unused variable 'v' [-
v = al_get_opengl_version();
extensions.c:768:28: error: no member named 'GetStringi'
in 'struct ALLEGRO_OGL_EXT_API'
warnings and 2
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..
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?
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.
Are you sure you actually configured the build system to build for iOS rather than OSX?
Thread #611728. Printed from Allegro.cc
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??