Glut.h, libglut32.a

I’ve been using MinGW to compile & link OpenGL sample programs. I started using the files glut.h and libglut32.a that came with the MinGW installation. However, I had lots of trouble (such as “undefined reference”), and so went to http://mywebpage.netscape.com/PtrPck/glut.htm and started using the glut.h and libglut32.a I found there. This has solved my problem.

Question # 1: why couldn’t I use the files glut.h and libglut32.a that came with the MinGW download?

Question # 2: the aforementioned web site says that “You can compile GLUT with Mingw32 …” I would like to try that. How do I go about it? How would I build libglut32.a?

Any advice would be much-appreciated.

Dana J.

I use DEV-C++ IDE, which interfaces to the mingw compiler. Free worth the download, nice GUI interface.

What version of the software do you have?

I did not have any trouble compiling a openGL program with the included library, on the version I am using.

I have not tried compiliing glut sources, so can not comment on that.

On my website is a link to the free DEV-C++ interface(IDE)/compiler:
www.angelfire.com/linux/nexusone/

Originally posted by Dana J.:
[b]I’ve been using MinGW to compile & link OpenGL sample programs. I started using the files glut.h and libglut32.a that came with the MinGW installation. However, I had lots of trouble (such as “undefined reference”), and so went to http://mywebpage.netscape.com/PtrPck/glut.htm and started using the glut.h and libglut32.a I found there. This has solved my problem.

Question # 1: why couldn’t I use the files glut.h and libglut32.a that came with the MinGW download?

Question # 2: the aforementioned web site says that “You can compile GLUT with Mingw32 …” I would like to try that. How do I go about it? How would I build libglut32.a?

Any advice would be much-appreciated.

Dana J.[/b]

nexusone:

Thanks for the recommendation regarding DEV-C++. I might try an IDE at some point, but I’d like to start with command-line compiles (partially just for the learning experience).

The GLUT version I have is 3.7.6.

Dana J.

I was talking about the version of the mingw compiler.

Also if you have not already checked out my site I have glut examples on it.

Going back to the first error you got with the mingw and the library shipped with it, did you include the glut library in liker. -lopengl32 -lglu32 -lglut32???

Originally posted by Dana J.:
[b]nexusone:

Thanks for the recommendation regarding DEV-C++. I might try an IDE at some point, but I’d like to start with command-line compiles (partially just for the learning experience).

The GLUT version I have is 3.7.6.

Dana J.[/b]

[This message has been edited by nexusone (edited 06-05-2003).]

nexusone:

I downloaded MinGW-2.0.0-3.exe from SourceForge.net, and the SourceForge web site says the gcc version is 3.2.3.

I invoke gcc as follows:
C:\MinGW\bin\gcc.exe cubev.c -o cubev.exe -lglut32 -lglu32 -lopengl32

Dana J.

I looked at the version I am using it is gcc 3.2, it has been a long time since I did any compiling from the command line and not a GUI.

Originally posted by Dana J.:
[b]nexusone:

I downloaded MinGW-2.0.0-3.exe from SourceForge.net, and the SourceForge web site says the gcc version is 3.2.3.

I invoke gcc as follows:
C:\MinGW\bin\gcc.exe cubev.c -o cubev.exe -lglut32 -lglu32 -lopengl32

Dana J.[/b]

Hi

I have been following your discussion with interest. But it doesn’t seem to answer the problem of using the GNU C compiler from DJGPP. I can’t even get my OpenGl material compiled (let alone linked and executed) using command line DJGPP. My compromise is to use VC++. Do I have to move again to MinGW ?

Best Wishes Peter Williams

I use MinGW through the DEV-C++ IDE interface, openGL program work well under it. Even nehe has ports of his tutors in DEV-C++ project format, just download them and load them as a project. Oh BTW did I say also that it was free!!!

I am not sure about the DJGPP GNU C, do you have a link to this site?

I can take a look at it and let you know something after you post the link.

How up to date is the compiler?

Originally posted by Peter Williams:
[b]Hi

I have been following your discussion with interest. But it doesn’t seem to answer the problem of using the GNU C compiler from DJGPP. I can’t even get my OpenGl material compiled (let alone linked and executed) using command line DJGPP. My compromise is to use VC++. Do I have to move again to MinGW ?

Best Wishes Peter Williams[/b]

The URL for DJ Delorie’s DJGPP compiler is: http://www.delorie.com/djgpp/

I wondered whether DJGPP’s compiler would be appropriate for use with OpenGL as DJGPP’s is for DOS app’s, only.

However, in reading http://www.delorie.com/djgpp/v2faq/faq10_4.html
it appears that DJGPP will work with Mesa.

In any case, I’ve settled on MinGW’s gcc.exe (C compiler) and c++.exe (C++ compiler). I’ve noticed that the executables created when I ask c++ to invoke the linker are approximately 10 times larger than the executables created when gcc invokes the linker.

Happy computing!

Dana J.

I had that similar problem with redbook examples with MinGW. I just added a line to include GL/gl.h before GL/glut.h. It’s annoying but it works. The worst problem is that some glut function “dump core”. I believe it could be a linking problem because the implementation of glutWireSphere (for instance) refers to a static pointer that isn’t explictly initialised. It’s assuming that the linker zeros the data segment. If anyone knows the appropriate linker command under MinGW (or perhaps the real solution to this problem) please let me know.

I have instructions on compiling OpenGL with djgpp on YouTube under samuelcarmichael: Compiling OpenGL in djgpp (dos). To link libraries, I used this folder -L"c:\dev-cpp\lib", then -lglut32 and made sure they were .a not .lib.

It’s pretty difficult. They have sample OpenGL programs that are much easier to compile when you create a new project in bloodshed dot net’s DevC++ (XP) and Codeblocks (for Windows 10).