GLUT - Error :(

Started by
12 comments, last by Kheteris 20 years, 7 months ago
Hi, I''m learning programing using the Redbook, which uses GLUT and for any of you people who are familiar w/ GLUT may be able to help me w/ this... When I''m compiling I get this error.... --------------------Configuration: cheese - Win32 Debug-------------------- Compiling... cheese.cpp c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2144: syntax error : missing '';'' before type ''void'' c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : fatal error C1004: unexpected end of file found Error executing cl.exe. cheese.exe - 3 error(s), 0 warning(s) When I double click on one of the errors it sends me to a hudge page of confusing code, anyone want to help me?
Advertisement
Did you include windows.h before including gl.h?
If you''re using GLUT, you shouldn''t directly include the OpenGL or GLU headers since their location and inclusion style differs depending upon the platform (as Dave Hunt was getting at: in Windows, the GL header includes WGL definitions for some reason, without first including other needed headers). Instead, just include the GLUT header, and it should take care of it.

Ahh, no. But that reveals that my School doesn''t have GLUT...

--------------------Configuration: cheese - Win32 Debug--------------------
Compiling...
cheese.cpp
Z:\cheese\cheese.cpp(3) : fatal error C1083: Cannot open include file: ''GL/glut.h'': No such file or directory
Error executing cl.exe.

cheese.exe - 1 error(s), 0 warning(s)

, know where I can download the header file?

opengl.org
yet, another stupid signature..
GLUT for Windows can be obtained here.

You need more than just the header. You need the library to linkt to, as well.
Okay, okay, where do I extract it to?
you can extract it where there are your source files (in a "GL/" directory for the header) and add ''./'' to your additionnal include directory.
quote:Original post by Kheteris
Okay, okay, where do I extract it to?


There is a link to the readme file at the link I provided. It explains how to install the package.
There is no glut.dsw file... or does it mean to select the workspace I am using for my program?

This topic is closed to new replies.

Advertisement