Object/library modules..........help?

as you can tell i’m kinda new at openGL, i normally use Mesa on Unix systems to use openGL.

http://www.opengl.org/resources/libraries/glut/
http://www.cs.csustan.edu/~rsc/SDSU/GLUTinstall.html

I found the above links which show how to use openGL on windows, but i can’t seem to get past step 6. When i got onto “Project” there is no option for “Settings”, which lead to a “Link” tab. The best I can find is Project > Properties > Linker. Am I completely lost?

can anyone help


  1. Choose “Properties” (a window will come up)

  2. On the left side of the window there is a tree, choose “Linker”, expand the sub-tree by clicking on the cross symbol. Then choose “Input”.

  3. The string field labeled “Additional Dependencies” has a few lib files already set in it

  4. Go to the end of this string field and enter:
    opengl32.lib glut32.lib glu32.lib


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

I don’t know where your gl.h and glu.h came from, but gl.h should not contain namespaces (isn’t this a C++ Keyword?). Have you installed some GL-Framework other than GLUT, which replaces the default files?

You should either try to compile you project with the C++ compiler, or reinstall your VS (or at least replaces gl.h an glu.h with the ones, which VS contains).

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.