PDA

View Full Version : Problem with using GLUT



Savail
09-01-2010, 02:48 PM
Hello
I Installed and configured C::B from this tutorial, so maybe some files are too old im not sure: http://www.levelbylevel.com/blog/opengl-c-and-glut-using-codeblocks-and-mingw-updated/#more-198
When I create OpenGL project, the default program runs properly, but when I include glut.h instead of gl.h there are errors inside the library glut.h at 483 500 and 546 line, like: undefined reference to "function name"
No matter what the code the error always appears whenever I include glut.h. I noticed Library GLUT has included gl.h and glu.h so i don't know what's wrong. I would be very grateful for your help.

I attach screenshot of the error, maybe it can help

ZbuffeR
09-01-2010, 03:41 PM
try putting :
#define GLUT_DISABLE_ATEXIT_HACK
before including glut.h

Savail
09-02-2010, 08:22 AM
Thanks a lot, you were right partly and now program is able to run but some functions aren't still recognised. What else I should do to make Opengl work for me fine? I will be very grateful again
I attach next screenshot

Savail
09-02-2010, 08:28 AM
alright problem is solved i hope. My opengl file didn't have glut32 linked and when I have done it everything worked fine. Thanks a lot for your help! By the way what means the line of code you posted here? It helped but I would like to know when do we use it.

ZbuffeR
09-02-2010, 09:10 AM
You use it when the code do not compile without :)
Or use Freeglut instead of old original Glut. Freeglut is better maintained.

BTW, next times, please copy and paste the *text* from the error window in your posts, much easier to read/search/etc than an ugly jpeg screenshot ...