Skip to main content
gamedev.net
🔒 Locked

compile errors

Started by cellman Jan 20, 2005 at 3:02 PM 1 replies 650+ views
Original Post
cellman
cellman
when i compile this code #include #include #include #include #pragma comment(lib,"OpenGl32.lib") GLenum doubleBuffer; GLint thing1, thing2; // This is usually the first function. It is called from main() // and runs only once static void Init(void) { // Set background color to black. (Intensity, red, green, blue). // Numbers may be between 0 and 1, inclusive. glClearColor(0.0, 0.0, 0.0, 0.0); glClearAccum(0.0, 0.0, 0.0, 0.0); thing1 = glGenLists(1); // create a list with 1 item glNewList(thing1, GL_COMPILE); glColor3f(1.0, 0.0, 0.0); // set the foreground color to red glRectf(-1.0, -1.0, 1.0, 0.0); // draw a rectangle glEndList(); // end list thing2 = glGenLists(1); // create a second list glNewList(thing2, GL_COMPILE); glColor3f(0.0, 1.0, 0.0); glRectf(0.0, -1.0, 1.0, 1.0); glEndList(); } static void Reshape(int width, int height) { // In OpenGL, matrices are used to manage the view. There are 2 matrix modes: // projection, which sets up the viewport and clipping boundary, and modelview // which rotates, translates, and scales objects. glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); // set matrix mode glLoadIdentity(); // load the identity matrix into the current matrix state glMatrixMode(GL_MODELVIEW); // set matrix mode glLoadIdentity(); // load the identity matrix into the current matrix state } // This function constantly checks for pressed keys. static void Key(unsigned char key, int x, int y) { switch (key) { // Polygons have a front and back face, properties may be set for both. // glPolygonMode controls the drawing mode for the specified face(s). Faces may be // specified as GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK. The mode specifies how the // polygon is to be drawn and may be GL_POINT, GL_LINE, or GL_FILL. case '1': glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glutPostRedisplay(); break; case '2': glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glutPostRedisplay(); break; case 27: exit(0); } } static void Draw(void) { glPushMatrix(); glScalef(0.8, 0.8, 1.0); glClear(GL_COLOR_BUFFER_BIT); glCallList(thing1); glAccum(GL_LOAD, 0.5); glClear(GL_COLOR_BUFFER_BIT); // clear the window glCallList(thing2); glAccum(GL_ACCUM, 0.5); glAccum(GL_RETURN, 1.0); glPopMatrix(); if (doubleBuffer) { glutSwapBuffers(); } else { glFlush(); } } static void Args(int argc, char **argv) { GLint i; doubleBuffer = GL_FALSE; for (i = 1; i < argc; i++) { if (strcmp(argv, "-sb") == 0) { doubleBuffer = GL_FALSE; } else if (strcmp(argv, "-db") == 0) { doubleBuffer = GL_TRUE; } } } int main(int argc, char **argv) { GLenum type; // gluInit() provides general initialization for the GLUT library glutInit(&argc, argv); Args(argc, argv); // ==== Set up display mode ==== type = GLUT_RGB | GLUT_ACCUM; // set type to RGB color with accum. // also set type to either double or single buffer type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; glutInitDisplayMode(type); // initialize the display mode glutInitWindowSize(300, 300); // set window size glutCreateWindow("OpenGL Sample Program"); // set window title Init(); // initialize OpenGL glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Draw); glutMainLoop(); } I get this compile error fatal error C1083: Cannot open include file: 'Gl/glut I think it has something to do with my header files and this one in perticuler #include
_the_phantom_
_the_phantom_
first, dont start multiple threads on the same problem, its both a waste of your time and other peoples.

Second, have you installed GLUT so its header is in the GL directory? because that error is telling you it cant find the file.
Deranged
Deranged
A: CROSSPOST!
B: You Don't Have GLUT, or The GLUT Header is not in the GL Directory!

You could have easily solved this by Googling glut.h.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.