Learning OpenGL

This is a discussion on Learning OpenGL within the C++ Programming forums, part of the General Programming Boards category; Hi, I'm learning OpenGL and I've found some code here I copy/pasted this into MS Visual Studio .NET. When compiling ...

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    35

    Learning OpenGL

    Hi, I'm learning OpenGL and I've found some code here
    I copy/pasted this into MS Visual Studio .NET. When compiling I get 102 errors...Here´s the code:

    Code:
    #include <GL/gl.h>
    #include <GL/glu.h>
    #include <GL/glut.h>
    #include <stdlib.h>
    
    static GLfloat spin = 0.0;
    
    void init(void) 
    {
       glClearColor (0.0, 0.0, 0.0, 0.0);
       glShadeModel (GL_FLAT);
    }
    
    void display(void)
    {
       glClear(GL_COLOR_BUFFER_BIT);
       glPushMatrix();
       glRotatef(spin, 0.0, 0.0, 1.0);
       glColor3f(1.0, 1.0, 1.0);
       glRectf(-25.0, -25.0, 25.0, 25.0);
       glPopMatrix();
       glutSwapBuffers();
    }
    
    void spinDisplay(void)
    {
       spin = spin + 2.0;
       if (spin > 360.0)
          spin = spin - 360.0;
       glutPostRedisplay();
    }
    
    void reshape(int w, int h)
    {
       glViewport (0, 0, (GLsizei) w, (GLsizei) h);
       glMatrixMode(GL_PROJECTION);
       glLoadIdentity();
       glOrtho(-50.0, 50.0, -50.0, 50.0, -1.0, 1.0);
       glMatrixMode(GL_MODELVIEW);
       glLoadIdentity();
    }
    
    void mouse(int button, int state, int x, int y) 
    {
       switch (button) {
          case GLUT_LEFT_BUTTON:
             if (state == GLUT_DOWN)
                glutIdleFunc(spinDisplay);
             break;
          case GLUT_MIDDLE_BUTTON:
             if (state == GLUT_DOWN)
                glutIdleFunc(NULL);
             break;
          default:
             break;
       }
    }
    
    /* 
     *  Request double buffer display mode.
     *  Register mouse input callback functions
     */
    int main(int argc, char** argv)
    {
       glutInit(&argc, argv);
       glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB);
       glutInitWindowSize (250, 250); 
       glutInitWindowPosition (100, 100);
       glutCreateWindow (argv[0]);
       init ();
       glutDisplayFunc(display); 
       glutReshapeFunc(reshape); 
       glutMouseFunc(mouse);
       glutMainLoop();
       return 0;
    }
    Any idea what's wrong?

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    You probably need GLUT installed and VC++ setup to use it. Do a search for GLUT, download it and follow the instructions.

  3. #3
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,812
    what are the errors do they look like undefined reference to blah::blah(). If so then check your linker and see if your including the opengl switch something like this -openGL. check out NeHe's site for openGl stuff ill even be kind and give you the windows lesson.
    http://nehe.gamedev.net/data/lessons....asp?lesson=01
    Woop?

  4. #4
    Registered User
    Join Date
    Jul 2004
    Posts
    35
    Errors:

    Code:
    Compiling...
    Main.cpp
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1153) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1153) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1153) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1153) : error C2146: syntax error : missing ';' before identifier 'glAlphaFunc'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1153) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1153) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1154) : error C2146: syntax error : missing ';' before identifier 'GLboolean'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1154) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1154) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1154) : error C2146: syntax error : missing ';' before identifier 'glAreTexturesResident'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1154) : error C2371: 'APIENTRY' : redefinition; different basic types
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1155) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1155) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1155) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1155) : error C2146: syntax error : missing ';' before identifier 'glArrayElement'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1155) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1155) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1156) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1156) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1156) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1156) : error C2146: syntax error : missing ';' before identifier 'glBegin'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1156) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1156) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1157) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1157) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1157) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1157) : error C2146: syntax error : missing ';' before identifier 'glBindTexture'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1157) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1157) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1158) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1158) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1158) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1158) : error C2146: syntax error : missing ';' before identifier 'glBitmap'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1158) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1158) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1159) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1159) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1159) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1159) : error C2146: syntax error : missing ';' before identifier 'glBlendFunc'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1159) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1159) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1160) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1160) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1160) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1160) : error C2146: syntax error : missing ';' before identifier 'glCallList'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1160) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1160) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1161) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1161) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1161) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1161) : error C2146: syntax error : missing ';' before identifier 'glCallLists'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1161) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1161) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1162) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1162) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1162) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1162) : error C2146: syntax error : missing ';' before identifier 'glClear'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1162) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1162) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1163) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1163) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1163) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1163) : error C2146: syntax error : missing ';' before identifier 'glClearAccum'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1163) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1163) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1164) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1164) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1164) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1164) : error C2146: syntax error : missing ';' before identifier 'glClearColor'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1164) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1164) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1165) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1165) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1165) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1165) : error C2146: syntax error : missing ';' before identifier 'glClearDepth'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1165) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1165) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1166) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1166) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1166) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1166) : error C2146: syntax error : missing ';' before identifier 'glClearIndex'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1166) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1166) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1167) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1167) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1167) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1167) : error C2146: syntax error : missing ';' before identifier 'glClearStencil'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1167) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1167) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1168) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1168) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1168) : error C2086: 'int WINGDIAPI' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'WINGDIAPI'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1168) : error C2146: syntax error : missing ';' before identifier 'glClipPlane'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1168) : error C2182: 'APIENTRY' : illegal use of type 'void'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1168) : error C2086: 'int APIENTRY' : redefinition
            C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1152) : see declaration of 'APIENTRY'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1169) : error C2144: syntax error : 'void' should be preceded by ';'
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1169) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1169) : fatal error C1003: error count exceeds 100; stopping compilation
    
    Build log was saved at "file://c:\Documents and Settings\harmen van tent.VANTENT-XNGIYOI\Mijn documenten\Visual Studio Projects\First_OpenGL\Debug\BuildLog.htm"
    Ugh....have a nice read =p Most of them are about GL.h using "void"

  5. #5
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Looks like #include <windows.h> should fix a lot of that. I cant remember but I think this might be included with glut.h, so try moving that include to the top of the list before gl.h and glu.h

    Try

    Code:
    #include <GL/glut.h>
    #include <GL/gl.h>
    #include <GL/glu.h>

  6. #6
    Registered User
    Join Date
    Jul 2004
    Posts
    35
    Ah great, thanks for that. Now I've only got two errors left:

    Code:
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1) : warning C4182: #include nesting level is 545 deep; possible infinite recursion
    C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\gl\GL.h(1) : fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit


    [EDIT]Ok, this isn't good. The GL.h header's code isn't right. I've been searching msdn for a while now, but I can't find the file. Anyone?[/EDIT]
    Last edited by HQSneaker; 08-05-2004 at 09:24 AM.

  7. #7
    Registered User
    Join Date
    Jul 2004
    Posts
    35
    Anyone gonna reply?

  8. #8
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    if your looking for the gl headers check www.opengl.org

    also, when using glut you dont need to include any of the other gl headers (exept gluax.h if you plan to use extensions). glut.h includes them for you.

    btw: a topic like this would get much more attention (and is probably better suited to) the Game Board. (yeah, i know its called the Game Board, but its really the Game/Graphics Board)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Learning OpenGL
    By comwiz in forum Game Programming
    Replies: 5
    Last Post: 04-11-2006, 02:05 AM
  2. Learning OpenGL
    By Feite in forum Game Programming
    Replies: 4
    Last Post: 10-13-2005, 09:54 AM
  3. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 01:34 PM
  4. OpenGL .dll vs video card dll
    By Silvercord in forum Game Programming
    Replies: 14
    Last Post: 02-12-2003, 07:57 PM
  5. Considering learning OpenGL
    By Panopticon in forum C++ Programming
    Replies: 19
    Last Post: 01-28-2003, 04:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21