Mingw32/SDL/OpenGL linker woes

Hi im trying to cross compile from linux->win32 using
mingw32, sdl, and opengl. Everything compiles ok, but
not matter what i do i cant get it to link.

I do this (the g++ here is mingw32)

g++ [.o files] -o out.exe -lglut32 -lglu32 -lopengl32
sdl-config --libs

sdl-config --libs is '-L/usr/i586-mingw32msvc/lib
-lmingw32 -lSDLmain -lSDL -mwindows

window.o(.text+0xbf):window.cpp: undefined reference
to glViewport' window.o(.text+0xcf):window.cpp: undefined reference to glMatrixMode’
window.o(.text+0xd7):window.cpp: undefined reference
to glLoadIdentity' window.o(.text+0x114):window.cpp: undefined reference to glOrtho’
window.o(.text+0x124):window.cpp: undefined reference
to glMatrixMode' window.o(.text+0x12c):window.cpp: undefined reference to glLoadIdentity’

Theres more undefined references, but they all are for
stuff thats in the normal GL headers. This app works
fine under linux natively. I think im missing a
library, but im not sure what it is.

-lopengl32 doesnt seem to do anything, i thought i was
supposed to use -lglut and -lSDL only…

do i need to install Mesa or something for mingw32?
ive been playing with this for hours and im really
confused… any insights would be greatly appreciated.

i might also point out that this is my first time
trying to compile SDL/mingw32 on this box, so
something could be screwed up.

thanks
-Dom__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

It looks like it’s not linking against libopengl32.a which should be in
the
i586-mingw32msvc/lib directory.

I get the same error if I remove the -lopengl32 when compiling.

Check to see if you have the libopengl32.a file and that the linker can
see it.

Bernard.

Dom> -----Original Message-----

From: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] On Behalf Of
Sent: Sunday, September 07, 2003 12:06 PM
To: sdl at libsdl.org
Cc: binary1230 at yahoo.com
Subject: [SDL] Mingw32/SDL/OpenGL linker woes

Hi im trying to cross compile from linux->win32 using
mingw32, sdl, and opengl. Everything compiles ok, but
not matter what i do i cant get it to link.

I do this (the g++ here is mingw32)

g++ [.o files] -o out.exe -lglut32 -lglu32 -lopengl32
sdl-config --libs

sdl-config --libs is '-L/usr/i586-mingw32msvc/lib
-lmingw32 -lSDLmain -lSDL -mwindows

window.o(.text+0xbf):window.cpp: undefined reference
to glViewport' window.o(.text+0xcf):window.cpp: undefined reference toglMatrixMode’
window.o(.text+0xd7):window.cpp: undefined reference
to glLoadIdentity' window.o(.text+0x114):window.cpp: undefined reference toglOrtho’
window.o(.text+0x124):window.cpp: undefined reference
to glMatrixMode' window.o(.text+0x12c):window.cpp: undefined reference toglLoadIdentity’

Theres more undefined references, but they all are for
stuff thats in the normal GL headers. This app works
fine under linux natively. I think im missing a
library, but im not sure what it is.

-lopengl32 doesnt seem to do anything, i thought i was
supposed to use -lglut and -lSDL only…

do i need to install Mesa or something for mingw32?
ive been playing with this for hours and im really
confused… any insights would be greatly appreciated.

i might also point out that this is my first time
trying to compile SDL/mingw32 on this box, so
something could be screwed up.

thanks
-Dom


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi im trying to cross compile from linux->win32 using
mingw32, sdl, and opengl. Everything compiles ok, but
not matter what i do i cant get it to link.

I do this (the g++ here is mingw32)

g++ [.o files] -o out.exe -lglut32 -lglu32 -lopengl32
sdl-config --libs

Try reversing the link order:

g++ [.o files] -o out.exe sdl-config --libs -lopengl32

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment