6 Replies - 17590 Views - Last Post: 28 June 2010 - 02:06 PM Rate Topic: -----

#1 Rekan  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 82
  • Joined: 19-August 09

having problem with opengl in visual studio c++ 2010 express

Posted 28 June 2010 - 12:13 PM

hi guys i am having a problem with setting opengl in visual studio c++ 2010 i think
because when i compile the following code:
#include<stdio.h>
#include<stdlib.h>
#include<glut.h>

void renderScene(void) {
	glClear(GL_COLOR_BUFFER_BIT);
	glBegin(GL_TRIANGLES);
		glVertex3f(-0.5,-0.5,0.0);
		glVertex3f(0.5,0.0,0.0);
		glVertex3f(0.0,0.5,0.0);
	glEnd();
	glFlush();
}
void main(int argc, char **argv) {
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);
	glutInitWindowPosition(100,100);
	glutInitWindowSize(320,320);
	glutCreateWindow("3D Tech- GLUT Tutorial");
	glutDisplayFunc(renderScene);
	glutMainLoop();
}



i get a compiler error:
1>LINK : fatal error LNK1104: cannot open file 'C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\glut32.obj'

i dont know what i have done wrong
Thanks for your help

Is This A Good Question/Topic? 0
  • +

Replies To: having problem with opengl in visual studio c++ 2010 express

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6039
  • View blog
  • Posts: 23,436
  • Joined: 23-August 08

Re: having problem with opengl in visual studio c++ 2010 express

Posted 28 June 2010 - 12:16 PM

Not a C++ Programmers question...this is a HELP question. Moved to C/C++...
Was This Post Helpful? 0
  • +
  • -

#3 ishkabible  Icon User is offline

  • spelling expret
  • member icon




Reputation: 1622
  • View blog
  • Posts: 5,709
  • Joined: 03-August 09

Re: having problem with opengl in visual studio c++ 2010 express

Posted 28 June 2010 - 01:22 PM

it's a linker issue, i think your linking to glut.h or something else, link instead to glut32.dll or glut32.lib. i think your also going to want to link to opengl32.lib and glu32.lib.
Was This Post Helpful? 0
  • +
  • -

#4 KazekageGaara  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 64
  • Joined: 09-June 10

Re: having problem with opengl in visual studio c++ 2010 express

Posted 28 June 2010 - 01:28 PM

View PostRekan, on 28 June 2010 - 11:13 AM, said:

hi guys i am having a problem with setting opengl in visual studio c++ 2010 i think
because when i compile the following code:


i get a compiler error:
1>LINK : fatal error LNK1104: cannot open file 'C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\glut32.obj'

i dont know what i have done wrong
Thanks for your help



add glut32.obj file in the folder said above....done that??
Was This Post Helpful? 0
  • +
  • -

#5 Rekan  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 82
  • Joined: 19-August 09

Re: having problem with opengl in visual studio c++ 2010 express

Posted 28 June 2010 - 01:42 PM

u mean glut32.lib? if yes then i have done it already
Was This Post Helpful? 0
  • +
  • -

#6 KazekageGaara  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 64
  • Joined: 09-June 10

Re: having problem with opengl in visual studio c++ 2010 express

Posted 28 June 2010 - 01:52 PM

add glut32.lib into additional dependencies in properties--->>>linker--->>>>input
Was This Post Helpful? 0
  • +
  • -

#7 Rekan  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 82
  • Joined: 19-August 09

Re: having problem with opengl in visual studio c++ 2010 express

Posted 28 June 2010 - 02:06 PM

Thanks my problem is solved ^^ i think i have cut/pasted it in the wrong folder XD
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1