thanks but i still didn’t work, i’m trying to run this simple program -
#include <GL/glut.h>
#define X_CENTRE 0.0
#define Y_CENTRE 0.0
#define LENGHT 1.0
void reshape(int width, int height)
{
glViewport(0,0,width,height);
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
}
void display(void)
{
glClear (GL_COLOR_BUFFER_BIT);
glColor3F(1.0, 1.0, 1.0);
glBegin(GL_POLYGON);
glVertex2f( X_CENTRE - LENGHT / 2, Y_CENTRE - LENGTH / 2);
glVertex2f( X_CENTRE - LENGHT / 2, Y_CENTRE + LENGTH / 2);
glVertex2f( X_CENTRE + LENGHT / 2, Y_CENTRE + LENGTH / 2);
glVertex2f( X_CENTRE + LENGHT / 2, Y_CENTRE - LENGTH / 2);
glEnd();
glFlush();
}
void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
}
int main(int argc, char** argc)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (400, 400);
glutInitWindowPosition (100, 100);
glutCreateWindow (argv[0]);
init();
glutDisplayFunc (display);
glutReshapeFunc (reshape);
glutMain ();
}
and end up getting all these errors
Output Window
Compiling...
test 3.c
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(3) : error C2061: syntax error : identifier 'namespace'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(3) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(4) : error C2061: syntax error : identifier 'namespace'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(4) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(4) : error C2143: syntax error : missing '{' before ':'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(4) : error C2059: syntax error : ':'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(5) : error C2061: syntax error : identifier 'namespace'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(5) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(5) : error C2143: syntax error : missing '{' before ':'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(5) : error C2059: syntax error : ':'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(6) : error C2061: syntax error : identifier 'namespace'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(6) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(6) : error C2143: syntax error : missing '{' before ':'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(6) : error C2059: syntax error : ':'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(7) : error C2061: syntax error : identifier 'namespace'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(7) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(7) : error C2143: syntax error : missing '{' before ':'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(7) : error C2059: syntax error : ':'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(8) : error C2061: syntax error : identifier 'namespace'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(8) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(8) : error C2143: syntax error : missing '{' before ':'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(8) : error C2059: syntax error : ':'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(11) : error C2061: syntax error : identifier 'openglb'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(11) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(11) : error C2449: found '{' at file scope (missing function header?)
c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(66) : error C2059: syntax error : '}'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(64) : error C2146: syntax error : missing ')' before identifier 'errCode'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(64) : error C2061: syntax error : identifier 'errCode'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(64) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(64) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(66) : error C2143: syntax error : missing '{' before '*'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(67) : error C2146: syntax error : missing ')' before identifier 'name'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(67) : error C2061: syntax error : identifier 'name'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(67) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(67) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(70) : error C2146: syntax error : missing ')' before identifier 'left'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(70) : error C2061: syntax error : identifier 'left'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(70) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(70) : error C2059: syntax error : ','
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(73) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(76) : error C2146: syntax error : missing ')' before identifier 'fovy'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(76) : error C2061: syntax error : identifier 'fovy'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(76) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(76) : error C2059: syntax error : ','
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(79) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(82) : error C2146: syntax error : missing ')' before identifier 'x'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(82) : error C2061: syntax error : identifier 'x'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(82) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(82) : error C2059: syntax error : ','
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(86) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(89) : error C2146: syntax error : missing ')' before identifier 'eyex'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(89) : error C2061: syntax error : identifier 'eyex'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(89) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(89) : error C2059: syntax error : ','
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(97) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(100) : error C2146: syntax error : missing ')' before identifier 'objx'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(100) : error C2061: syntax error : identifier 'objx'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(100) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(100) : error C2059: syntax error : ','
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(108) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(111) : error C2146: syntax error : missing ')' before identifier 'winx'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(111) : error C2061: syntax error : identifier 'winx'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(111) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(111) : error C2059: syntax error : ','
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(119) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(123) : error C2146: syntax error : missing ')' before identifier 'format'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(123) : error C2061: syntax error : identifier 'format'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(123) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(123) : error C2059: syntax error : ','
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(131) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(135) : error C2146: syntax error : missing ')' before identifier 'target'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(135) : error C2061: syntax error : identifier 'target'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(135) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(135) : error C2059: syntax error : ','
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(140) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(143) : error C2146: syntax error : missing ')' before identifier 'target'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(143) : error C2061: syntax error : identifier 'target'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(143) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(143) : error C2059: syntax error : ','
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(149) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(184) : error C2146: syntax error : missing ')' before identifier 'normals'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(184) : error C2081: 'GLenum' : name in formal parameter list illegal
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(184) : error C2061: syntax error : identifier 'normals'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(184) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(184) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(188) : error C2146: syntax error : missing ')' before identifier 'textureCoords'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(188) : error C2081: 'GLboolean' : name in formal parameter list illegal
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(188) : error C2061: syntax error : identifier 'textureCoords'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(188) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(188) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(192) : error C2146: syntax error : missing ')' before identifier 'orientation'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(192) : error C2081: 'GLenum' : name in formal parameter list illegal
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(192) : error C2061: syntax error : identifier 'orientation'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(192) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(192) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(196) : error C2146: syntax error : missing ')' before identifier 'drawStyle'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(196) : error C2081: 'GLenum' : name in formal parameter list illegal
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(196) : error C2061: syntax error : identifier 'drawStyle'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(196) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(196) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(200) : error C2146: syntax error : missing ')' before identifier 'baseRadius'
c:\program files\microsoft visual studio 8\vc\include\gl\glu.h(200) : fatal error C1003: error count exceeds 100; stopping compilation
Results
Build log was saved at "file://c:\Documents and Settings\JWorksUK\My Documents\Visual Studio 2005\Projects est3 est3\Debug\BuildLog.htm"
test3 - 102 error(s), 0 warning(s)
thanks for your help anyway