Compiling with DJGPP, include files

I have installed GLUT for Win32 version 3.7.6 from the CD accompanying Edward Angel’s book. Included therein are the files: glut.def, glut.h, glut32.dll, & glut32.lib.

I want to use DJGPP’s C compiler to compile one of Angel’s examples for Windows 98. I realize I need include files gl.h and glu.h (and possibly glext.h?). I’ve found these include files as part of Mesa-5.0.1.

Question # 1: are Mesa’s include files are the right ones to use? If not, from where should I get the correect ones?

I’ve reached the point where GNU’s linker (ld.exe) says it cannot find C:\WINDOWS\SYSTEM\OpenGL32.dll – however, I know that this file is there.

Question 2: am I compiling/linking correctly (see below)?

With thanks,

Dana J.

<-- see below for compiler invocation -->
gcc cubev.c -o cubev.exe -I…\GLUT\glut-3.7.6-bin -I…\GLUT\Mesa-5.0.1\includ
e -l C:\WINDOWS\SYSTEM\OpenGL32.dll -l C:\WINDOWS\SYSTEM\glu32.dll -lm
In file included from cubev.c:11:
…/GLUT/glut-3.7.6-bin/glut.h:151:1: warning: “APIENTRY” redefined
In file included from …/GLUT/glut-3.7.6-bin/glut.h:137,
from cubev.c:11:
…/GLUT/Mesa-5.0.1/include/GL/gl.h:92:1: warning: this is the location of the pr
evious definition
cubev.c: In function main': cubev.c:87: warning: return type ofmain’ is not `int’
c:/djgpp/bin/ld.exe: cannot find -lC:\WINDOWS\SYSTEM\OpenGL32.dll
collect2: ld returned 1 exit status

Not used to using gcc on windows, but aren’t you supposed to link to the .lib that you should also have, and the .dll is implied in doing this.

The .lib files and .h are obviously the development only files and typically reside in some dev folder (only the dll goes in windows system), this may be based on whatever SDK you installed it from, I doubt you have an MSDEV dir with gcc, but you should know where you have these.

[This message has been edited by dorbie (edited 05-29-2003).]

Get the headers and libs from here http://www.opengl.org/users/downloads/index.html
Drop the dlls into your C:\WIN???\system folder and the libs in your DJGPP lib folder and your headers into DJGPP include folder.

Hope that helps

Is the book OpenGl A Primer by Angel? Mine didn’t come with a CD

Thor,
No, the book is not Angel’s Primer.
Instead, it is his textbook
Interactive Computer Graphics:
A Top-Down Approach Using OpenGL

http://www.aw.com/catalog/academic/product/0,4096,0201773430,00.html

Dana J.