im new to programming with opengl, and im using GLUT for windows. I use gcc for windows to compile, but when i compile (its an example from the book: OpenGL Programming Guide Third edition, so it cant be badly coded) it throws me some errors:
C:\windows emp\ccZAufgb.o(.text+0x2ea):cuad.c: undefined reference to `glutMainLoop’
It throws me many of this errors more than 10 (it goes off the DOS window). If someone can help me i will be very appreciated, since i really want to learn how to program in opengl
Sorry for my poor english but im from Argentina
Either you forgot to link with glut, or you’re linking in the wrong order. I think this is how you normally link with GLUT from gcc:
gcc myrpog.c -o myprog.exe -lglut -lglu32 -lopengl32
(or perhaps it’s -lglut32, depending on what dll you’re using, I suppose)
Hi, thx for the answer marcus, i was missing the link to the library glu, but when i added it it still gave me the same errors
This is how i compile it with the gcc:
gcc myprog.c -o myprog.exe -Iincludedir -Llibrariesdir -lglut32 -lglu32 -lopengl32
I’ve also tried using -lglut but its the same, any ideas on this?
EDIT: hows that about linking with wrong order?, also i dont know if it helps but im using glut3.7 and opengl1.1
[This message has been edited by Batsu (edited 07-08-2002).]
Try this command line:
gcc myprog.c -o myprog.exe -Iincludes -lglut32 -lglu32 -lopengl32
(! WITHOUT -Lglut_libs)
It works on some versions.
Also it is better to use -mwindows option.