PDA

View Full Version : glut.h, libglut32.a



06-04-2003, 06:19 PM
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.

nexusone
06-05-2003, 04:02 AM
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/ (http://www.angelfire.com/linux/nexusone/)



Originally posted by Dana J.:
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.

06-05-2003, 08:24 AM
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.

nexusone
06-05-2003, 08:56 AM
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.:
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.



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

06-05-2003, 02:21 PM
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.

nexusone
06-06-2003, 04:45 AM
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. http://www.opengl.org/discussion_boards/ubb/biggrin.gif


Originally posted by Dana J.:
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.

06-10-2003, 04:43 AM
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

nexusone
06-10-2003, 05:23 AM
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:
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

06-10-2003, 05:41 PM
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.

steven_shaw
06-30-2003, 05:10 AM
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.