[SDL] SDL + GL2.0 GLSL Cross Compiling Problem

Eric Vidal evidal at ateneo.edu
Wed Jan 19 22:05:09 PST 2005

Chris Nelson wrote:
> I seem to have a version of libopengl32.a, which doesn't seem to support 
> the OpenGL 2.0 GLSL extension function calls. Cross compiling my program 

The problem is that the Windows OpenGL library doesn't have the 2.0 
functions.  It only supports up to 1.1.

What I do is to create pointers to the functions that are only for 1.2+ 
OpenGL versions, and then use SDL_GL_GetProcAddress to resolve them. 
More info can be found in the manpage or the HTML docs.  You should also 
get the glext.h and wglext.h header files from 
http://oss.sgi.com/projects/ogl-sample/registry/ to get the OpenGL 2.0 
constants, if you need them.

Theoretically you can link instead with a third-party OpenGL library, 
but I've never been consistently successful with that.  :)

> -Lmingw32/lib -lmingw32 -lSDLmain -lSDL -lSDL_sound -lSDL_image 
> -lSDL_net -lopengl32 -lglu32 -mwindows

I think putting -lglu32 before -lopengl32 should solve the glu problem.  :)

Eric Vidal
Lecturer / Graduate Research Assistant, DISCS
Ateneo de Manila University

More information about the SDL mailing list