MinGW OpenGL?

I’m trying out the MinGW UNIX-like environment for Windows and I want to compile UNIX OpenGL programs. I have the MinGW environment working in general. gcc --version reports 3.4.2 from a Command Prompt window or an MSYS window.

How to I tell gcc (or maybe somebody’s configure script) to link against the OpenGL DLL already installed under Windows? Or is there a better way?

It finds gl.h, glext.h, etc., I just don’t know how to link with opengl32.dll or whatever.

thanks

Hi, to link OpenGL features with MinGW compiler you must use the following argument in your cmd prompt
-lopengl -lglu -glut…

hope that helps

thanks, I’m trying that now

In general can you link with a normal Windows DLL such as lib.dll by simply doing a -llib option?

My OpenGL program works under MinGW and Windows XP with the -lopengl32 and -lglu32 options to gcc. Thanks.

Apparently libopengl32.a (included with MinGW) knows to use the windows opengl32.dll library. Come to think of it I may have read about DLL’s normally working that way, but it’s been awhile.

I’m happy to not need a proprietary compiler for my OpenGL project!!! MinGW/MSYS is nice too.

In general can you link with a normal Windows DLL such as lib.dll by simply doing a -llib option?
I think yes, but I’m not a GCC user so if I’m in the wrong way, other can correct…

I’m happy to not need a proprietary compiler for my OpenGL project!!! MinGW/MSYS is nice too
First step into the path of freedom :-?

First time getting my win32 projects to build with gcc instead of Some Other compiler. I’m mainly a UNIX/Linux C++ progammer so I prefer gcc.

Thank you for the help.

It was very satisfying yesterday when I ran my program from a “UNIX” (MinGW) prompt for the first time and saw my 3D graphics pop up as a reward.

Glad to help you :slight_smile:

I’m using Dev-C++ (which uses gcc as compiler) and it works great!
the only linking option I give is -lopengl32
and it works. I think it calls opengl.dll, because executables are very little :smiley:

I’m using minGW. I’m trying and compile the examples from the red-book, but I have problems with “glutSolidSphere()”: it doesn’t exist in glu.h nor in glext.h!
In the include/GL directory there are only gl.h, glu.h and glext.h: any clue? :frowning:

The glut library is not free source software and thus would not be included in MinGW.

However, I’ve heard of a free source rewrite of glut called freeglut and/or OpenGLUT:

http://freeglut.sourceforge.net/
http://openglut.sourceforge.net/

I’ve never tried it so please reply if you try it and it works for you.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.