2

I followed every instruction on OpenGL-tutorial.org, downloading the 2.1 code, running it through cmake specifying xcode and using its default compilers. I configured till the red lines were gone then clicked generated. The project file it generated though, when opened in xcode displays the following errors:

 /OpenGL-tutorial_v0010_21/external/AntTweakBar-1.15/src/LoadOGLCore.h:149:24: Conflicting types for 'glMultiDrawElements'

 /OpenGL-tutorial_v0010_21/external/AntTweakBar-1.15/src/LoadOGLCore.h:214:24: Conflicting types for 'glShaderSource'

 /external/AntTweakBar-ObjectiveC/LoadOGLCore.mm:116:1: Cannot initialize a variable of type 'PFNglMultiDrawElements' (aka 'void (*)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei)') with an lvalue of type 'void (GLenum, const GLsizei *, GLenum, const GLvoid *const *, GLsizei)': type mismatch at 4th parameter ('const GLvoid **' (aka 'const void **') vs 'const GLvoid *const *' (aka 'const void *const *'))

 /external/AntTweakBar-ObjectiveC/LoadOGLCore.mm:116:1: Cannot initialize a variable of type 'PFNglMultiDrawElements' (aka 'void (*)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei)') with an lvalue of type 'void (GLenum, const GLsizei *, GLenum, const GLvoid *const *, GLsizei)': type mismatch at 4th parameter ('const GLvoid **' (aka 'const void **') vs 'const GLvoid *const *' (aka 'const void *const *'))

I am using Xcode 4.6.1 and cmake 2.8-10

Could this be something wrong with cmake or the tutorials code?

2
  • 1
    unrelated: The OpenGL interface on MacOS is outdated, so the more time passes, the more you will find outdated tutorials for this particular combination. sorry :/
    – scones
    Apr 7, 2013 at 8:51
  • I've been noticing this more and more. It has been a nightmare to find anything relevant enough to get even a basic start. :(
    – qs-uc
    Apr 7, 2013 at 8:54

3 Answers 3

4

The first two errors are easy enough to fix, maybe it will fix the other two. Notice the signature in gl.h for glShaderSource. It is:

extern void glShaderSource (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length);

The third parameter is a 'const pointer to a const pointer to string.'

However, notice that the signature in LoadOGLCore.h is (expanding the macro):

extern "C" { void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar * *string, const GLint *length);

The third parameter is a 'const pointer to a string pointer' (missing the 'const'). So, open up LoadOGLCore.h and change (on line 214):

const GLchar* *string

to:

const GLchar* const *string

Do the same for the other error regarding glMultiDrawElements. This allowed me to at least build AntTweakBar on OSX 10.8.5. Still haven't tried to run a sample project yet, but I'll update when I do.

0
0

go to the definition of those functions and replace the prototype with the correct (update) parameter definitions

0

Author here,

Welcome on StackOverflow, and thanks for reading opengl-tutorial.org !

This is a known issue (on 10.8 only, which I don't have). However, AntTweakBar, which provides a simple GUI, is only used for the very last tutorial. Other sub-projects should build just fine. Just in case, you can remove lines 367 to 385 in the CMakeLists.txt file, and rerun CMake.

I'll update this post when it'll be fixed. Sorry for the inconvenience !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.