PDA

View Full Version : GLUT and DJGPP



vr
02-19-2001, 08:13 AM
Hihi, I am new to programming with GLUT, but I now need to develop a program based on GLUT, using DJGPP. I have downloaded the Mesa GLUT and have included the gl\glut.h in the main .cpp file. Here are the details:

main source: test.cpp
class: test_class.cpp, test_class.h

after I have:
gcc -c test.cpp
and:
gcc -c test_class.cpp

then I type:
gcc -o test.exe test.o test_class.o -lglut32 -lGLU32 -lOpenGL32

then the compiler(ld.exe) complains that the file "-lglut32" was not found.

I have tried something like: -lglut -lMesaGLU, etc...but the result is the same.

I have copied the glut32.lib, GLU32.lib and OpenGL32.lib into the compiler's library directory already, how come it cannot be linked? Can someone help me????
Thanks in advance!!!

Fredy
02-19-2001, 08:59 AM
glut32.lib??? what's that? DJGPP library extensions are *.a . Try to copy libglut.a into DJGPP/LIB directory. But don't forget that Mesa GLUT implementation is not complete!

vr
02-19-2001, 09:03 AM
thx a lot Fredy!
I have browsed the djgpp/lib directory and found some .a there
but could you tell me how to get the .a lib for mesa/glut of djgpp?
thanks!!!

Fredy
02-19-2001, 09:13 AM
try: make -f makefile.dja or make -f makefile.dj depends on that if you use Allegro or not.
Be sure that the make.exe is the "djgpp make.exe".

vr
02-19-2001, 09:18 AM
Thx again Fredy for your prompt reply!
Could you tell me if I could get directly a pre-compiled .a library for djgpp? or, if I make it myself, how can I do it in dos? coz I have browsed the djgpp directory but could not find any make.exe, and I am using windows/dos. Moreover, is allegro a library supporting opengl? Really thx for your kind help!

Fredy
02-19-2001, 09:33 AM
Allegro don't support OpenGL but Mesa implementation of OpenGL for DJGPP uses Allegro.
You can get Allegro from http://www.talula.demon.co.uk/ and make.exe for DJGPP from: http://www.delorie.com/ but i send you a mail with precompiled gl, glu, glut libraries an make.exe too. (I don't know if these libraries work with a other version of gcc than 2.81).

vr
02-19-2001, 09:44 AM
Thx so much Fredy! I have copied the .a to the lib directory. Now the gcc can find the library, but it reports some errors:

libgl.a(amesa.o)(.text...):amesa.c: undefined reference to .....

is it bcoz my djgpp version problem?
or should I add other -l options besides -lglu, -lgl -lglut ?
Thanks again!

Fredy
02-19-2001, 10:09 AM
1. Get Allegro 3.9.34 WIP!!! if you don't have it.
2. order of libraries: -lglut -lglu -lgl -lalleg
3. Be sure to rename the file lib/glut_h.dja to lib/glut.h
And if it still not work then try to compile Mesa again with the djgpp make.exe but beware the makefile.dja isn't correct! (You should go to delorie site and get all required files for compiling with djgpp (use the Zip Picker)). If the compilation goes wrong then you shoud reply me later and i will try to help you. (And write the whole error message not only blah,blah...)

vr
02-19-2001, 10:25 AM
Many thanks! Fredy!
I am trying what you suggest. I am getting more and more clear now. I hope it will work. Anyway, really have to thank you for your prompt and kind help! I will trouble you again if I still cannot get it work!! Thanks a lot!!!!!

vr
02-19-2001, 12:42 PM
Hi Fredy, sorry have to bother you again. I have successfully make the allegro, then I used it with the .a files (gl glu glut) u sent me previous and the following error occured:

.../djgpp/lib/libglut.a(init.o)(.text+0x538):init.c: undefined reference to 'install_allegro'

Then, I tried to make a new mesa-3.4.1 myself, and yes, the makefile.dja has errors:
make.exe[1]: Entering directory .../mesa-3~1.1/src'
Makefile.dja:117: depend.dja: No such file or direcory (ENOENT)
make.exe[1]: *** No rule to make target 'depend.dja'. Stop.
make.exe: *** [libs] Error2

Then, I tried to go to the 117th line of the makefile.dja in the ./src directory and comment out the depend.dja, and got the following errors:

make.exe[1]: Entering directory .../mesa-3~1.1/src'
make.exe[1]: *** No rule to make target 'aatriangle.h', needed by 'aatriangle.o'. Stop.
make.exe[1]: Leaving directory '.../mesa-3~1.1/src'
make.exe: *** [libs] Error 2
Could you suggest how to solve? THANKS AGAIN!!!

Fredy
02-20-2001, 11:11 AM
Hi vr! I have looked at the Mesa 3.2 and i maked a fix: http://www.kmit.sk/~grex/ this should
compile without errors.
the error message:
.../djgpp/lib/libglut.a(init.o)(.text+0x538):init.c: undefined reference to 'install_allegro'
could mean (just a guess) that you forget to copy allegro files into djgpp dir. (lalleg.a, headers...) in allegro dir type: make install.
But Mesa implementation of OpenGL for djgpp is really ****ty. If you want make some really cool stuff code under Windows (VC, ...) or Linux, ..

[This message has been edited by Fredy (edited 02-20-2001).]

vr
02-21-2001, 06:45 AM
Thanks so much, Fredy!
I will try it out immediately. Really appreciate your kind help!!