Search code examples
macosopenglglew

Building glew for Mac OSX


I have spent the day struggling to get my simple engine to work on Mac. I have SDL working and now the only thing giving trouble is opengl. The engine uses modern opengl (shader based) and so requires GLEW. I have tried everything from fink to MacPorts to install it and nothing works.

The most success I have had has been building it from source. First I got an error saying 'GL/glu.h' no such file or directory found. So I renamed the includes to OpenGL/glu.h and that fixed that issue. But now I get this error ld: unknown option: -shared I am completely stuck at this point.

Also Id rather a static build if anyone knows how to do that.


Solution

  • The engine uses modern opengl (shader based) and so requires GLEW

    GLEW is not a prerequisite for using modern OpenGL features. It is a method to load extended functionality, not the only one. You're on MacOS X so, the extension system is of little use for you anyway, because the OpenGL version supported is entirely determined by the OS and the available framework. Apple develops the OpenGL drivers themself and the extensions they provide are only those, that are for features not found in the OpenGL specification (i.e. vendor specific and EXT). All you need is a version of the OpenGL Framework new enough. Any MacOS X released after 2006 can do it.