C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 08-05-2004, 05:08 AM   #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?
HQSneaker is offline   Reply With Quote
Old 08-05-2004, 05:15 AM   #2
&TH of undefined behavior
 
Fordy's Avatar
 
Join Date: Aug 2001
Posts: 5,183
You probably need GLUT installed and VC++ setup to use it. Do a search for GLUT, download it and follow the instructions.
__________________
"If A is success in life, then A equals x plus y plus z. Work is x; y is play; and z is keeping your mouth shut."
Albert Einstein (1879 - 1955)


Board Rules
Fordy is offline   Reply With Quote
Old 08-05-2004, 05:18 AM   #3
Sweet
 
Join Date: Aug 2002
Location: Tucson, Arizona
Posts: 1,678
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?
prog-bman is offline   Reply With Quote
Old 08-05-2004, 05:28 AM   #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"
HQSneaker is offline   Reply With Quote
Old 08-05-2004, 06:10 AM   #5
&TH of undefined behavior
 
Fordy's Avatar
 
Join Date: Aug 2001
Posts: 5,183
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>
__________________
"If A is success in life, then A equals x plus y plus z. Work is x; y is play; and z is keeping your mouth shut."
Albert Einstein (1879 - 1955)


Board Rules
Fordy is offline   Reply With Quote
Old 08-05-2004, 07:15 AM   #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 08:24 AM.
HQSneaker is offline   Reply With Quote
Old 08-06-2004, 01:56 AM   #7
Registered User
 
Join Date: Jul 2004
Posts: 35
Anyone gonna reply?
HQSneaker is offline   Reply With Quote
Old 08-06-2004, 08:57 AM   #8
Crazy Fool
 
Perspective's Avatar
 
Join Date: Jan 2003
Location: Canada
Posts: 2,588
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)
Perspective is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Learning OpenGL comwiz Game Programming 5 04-11-2006 01:05 AM
Learning OpenGL Feite Game Programming 4 10-13-2005 08:54 AM
OpenGL Window Morgul Game Programming 1 05-15-2005 12:34 PM
OpenGL .dll vs video card dll Silvercord Game Programming 14 02-12-2003 07:57 PM
Considering learning OpenGL Panopticon C++ Programming 19 01-28-2003 04:51 AM


All times are GMT -6. The time now is 12:27 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

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