Hi, my name is Danny and I am very new to Visual C++ and OpenGL. I began using NeHe's tutorials and everything was going great. Later, I wanted to try some clipping so I transfered this code from OpenGL Programming Guide (the red book, pg 107):
this is the first time I encountered these errors. This is just a few of the errors I recieved:Code:#include <windows.h> #include <gl\gl.h> #include <gl\glu.h> #include "aux.h" void display(void) { GLdouble eqn[4] = {0.0,1.0,0.0,0.0}; GLdouble eqn2[4] = {1.0,0.0,0.0,0.0}; glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0,1.0,1.0); glPushMatrix(); glTranslatef(0.0,0.0,-0.5); glClipPlane(GL_CLIP_PLANE0, eqn); glEnable(GL_CLIP_PLANE0); glClipPlane(GL_CLIP_PLANE1, eqn2); glEnable(GL_CLIP_PLANE1); glRotate(9.0,1.0,0.0,0.0); auxWireSphere(1.0); glPopMatrix(); glFlush(); } void myinit(void); { glShadeModel(GL_FLAT); } void myReshape(GLsizei w, GLsizei h) { glViewport(0,0,w,h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(60.0, (GLfloat) w /(GLfloat) h, 1.0,20.0); glMatrixMode(GL_MODELVIEW); } int main(int argc, char** argv); { auxInitDisplayMode(AUX_SINGLE | AUX_RGBA); auxInitPosition(0,0,500,500); auxInitWondow(argv[0]); myinit(); auxReshapeFunc(myReshape); auxMainLoop(display) }
c:\program files\microsoft visual studio\vc98\include\gl\glu.h(384) : error C2165: 'left-side modifier' : cannot modify pointers to data
c:\program files\microsoft visual studio\vc98\include\gl\glu.h(384) : error C2071: 'GLUnurbsErrorProc' : illegal storage class
c:\program files\microsoft visual studio\vc98\include\gl\glu.h(561) : error C2061: syntax error : identifier 'GLenum'
c:\program files\microsoft visual studio\vc98\include\gl\glut.h(535) : error C2146: syntax error : missing ')' before identifier 'layer'
c:\program files\microsoft visual studio\vc98\include\gl\glut.h(535) : warning C4229: anachronism used : modifiers on data are ignored
c:\program files\microsoft visual studio\vc98\include\gl\glut.h(535) : error C2182: 'glutUseLayer' : illegal use of type 'void'
c:\program files\microsoft visual studio\vc98\include\gl\glut.h(535) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\gl\glut.h(600) : error C2061: syntax error : identifier 'GLfloat'
c:\program files\microsoft visual studio\vc98\include\gl\glut.h(601) : error C2143: syntax error : missing ';' before '__stdcall'
c:\program files\microsoft visual studio\vc98\include\gl\glut.h(605) : error C2146: syntax error : missing ')' before identifier 'type'
After trying to resolve these problems and making sure I linked the appropriate libraries(OpenGL32.lib GLu32.lib GLaux.lib), I placed the above code in a newly downloaded NeHe tutorial and I got the same errors. Now everything I compile in Visual C++ is incurring the same errors, whether they are simple programs I wrote or tutorials I downloaded!!
I would greatly appreciate some assistance regarding this issue, thanks and have a great day!!
Danny



LinkBack URL
About LinkBacks


