PDA

View Full Version : Compiling with DJGPP, include files



05-29-2003, 05:10 AM
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 of `main' is not `int'
c:/djgpp/bin/ld.exe: cannot find -lC:\WINDOWS\SYSTEM\OpenGL32.dll
collect2: ld returned 1 exit status

dorbie
05-29-2003, 06:55 AM
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).]

shinpaughp
05-29-2003, 03:09 PM
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

05-31-2003, 10:23 PM
Is the book OpenGl A Primer by Angel? Mine didn't come with a CD

06-02-2003, 03:55 AM
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.