Can't find -LGL with MinGW

I’ve just installed Msys and Mingw in Windows because I’m wanting to
port my SDL game to Windows. I installed Msys and Mingw as normal and
added mingw to my msys fstab and then I untarred the SDL source did
"./configure --prefix=/mingw && make && make modules install".

I can compile normal SDL programs fine but when it comes to a program
using OpenGL I get an error like “Can’t find -LGL” or “Can’t find -GL”.
I’m compiling the program like “g++ program.cpp -o program -lGL -lGLU
sdl-config --cflags --libs”. I know normally that this mean I havn’t
got the OpenGL libraries or headers installed but in /usr/include/GL
there exists gl.h, glu.h and glext.h so I know it’s not the headers.
I’ve had a look for libgl.so which is what I think the file I need is
but I can’t find it. In /usr/lib there are lots of .a files one of which
I believe is libglext.a or something like that but there isn’t a libgl.a.

Any ideas?

you would be looking for -lopengl32
if your missing it, perhaps google for libopengl32 ?

Darrell Blake wrote:> I’ve just installed Msys and Mingw in Windows because I’m wanting to

port my SDL game to Windows. I installed Msys and Mingw as normal and
added mingw to my msys fstab and then I untarred the SDL source did
"./configure --prefix=/mingw && make && make modules install".

I can compile normal SDL programs fine but when it comes to a program
using OpenGL I get an error like “Can’t find -LGL” or “Can’t find
-GL”. I’m compiling the program like "g++ program.cpp -o program -lGL
-lGLU sdl-config --cflags --libs". I know normally that this mean I
havn’t got the OpenGL libraries or headers installed but in
/usr/include/GL there exists gl.h, glu.h and glext.h so I know it’s
not the headers. I’ve had a look for libgl.so which is what I think
the file I need is but I can’t find it. In /usr/lib there are lots of
.a files one of which I believe is libglext.a or something like that
but there isn’t a libgl.a.

Any ideas?


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

you would be looking for -lopengl32

So I should be compiling like “g++ program.cpp -o program -lopengl32
sdl-config --cflags --libs”?

sounds reasonable :slight_smile: ?

Darrell Blake wrote:> > you would be looking for -lopengl32

So I should be compiling like “g++ program.cpp -o program -lopengl32
sdl-config --cflags --libs”?


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

i should mention there is also -lglu32 / -lglu and -lglut32 if you have
glut installed. I believe libopengl32.a and libglu32.a / libglu.a are
included with mingw.

"g++ program.cpp -o program -lopengl32 -lglu32 sdl-config --cflags --libs"?

Darrell Blake wrote:> > you would be looking for -lopengl32

So I should be compiling like “g++ program.cpp -o program -lopengl32
sdl-config --cflags --libs”?


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