SDL + GL2.0 GLSL Cross Compiling Problem

I’m trying to cross compile a game from linux to windows.

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
w/ mingw32 works fine, but linking generates this:—

undefined reference to `_gluLookAt’

undefined reference to _glShaderSource... at 16' undefined reference to_glCompileShader… at 4’
undefined reference to _glGetObjectParameteriv... at 12' undefined reference to_glGetInfoLog… at 16’
undefined reference to _glCreateProgramObject... at 0' undefined reference to_glAttachObject… at 8’
undefined reference to _glLinkProgram... at 4' undefined reference to_glValidateProgram… at 4’
undefined reference to _glGetObjectParameteriv... at 12' undefined reference to_glUseProgramObject… at 4’


Anybody know how to fix this? It doesn’t seem as if it’s finding glu,
either.

Here’s the important part of my linking line:


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


The directory mingw32/lib contains all my win32 libraries, but either
they aren’t the latest versions (in the case of libopengl32.a, I think),
or they don’t seem to be working (libglu32.a).

If anybody has any ideas, that’d be great. I’m quite stuck on this.
Thanks in advance.

-Chris

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

-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
http://aegis.ateneo.net/evidal/

Use glew (http://glew.sf.net). It has opengl 2.0 compatible header file with
all the defs and function prototypes, and it loads the function pointers
during startup for you… in windows, linux, osx, freebsd etc.

And it’s simple to use.

– Pasi K?rkk?inen

                               ^
                            .     .
                             Linux
                          /    -    \
                         Choice.of.the
                       .Next.Generation.On Thu, Jan 20, 2005 at 02:05:09PM +0800, Eric Vidal wrote:

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