Wednesday, June 10, 2009

Installing freeglut on Visual Studio 2008

There are 3 things you need:
*Visual Studio 2008
*OpenGL
*freeglut

download the following files
1. freeglut 2.4.0
donload link:

2. GLUT win32 binaries
download link:
download the bin.zip file in some kb's i guess

Files must be placed in the correct directories. For Visual Studio .NET 2003 and above (or Windows XP/Vista) those are the following below. Note: according to a comment post below, for Windows Vista 64-bit, you have to put the libraries (*.dll) into Windows\SysWOW64 directory.


  • Put freeglut.h in: ‘C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL\’ (note: you'll have to create the GL folder)
  • Put freeglut_ext.h in: ‘C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL\’
  • Put freeglut_std.h in: ‘C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL\’
  • Put freeglut.lib in: ‘C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\’
  • Put freeglut.dll in: ‘C:\WINDOWS\system32\’
  • Put glut32.dll in: ‘C:\WINDOWS\system32\’
  • Put glut32.lib in: ‘C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\’
  • Put glut.h in: ‘C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL\’

Ok, now that you've "installed" freeglut, you need to make the C++ project aware of freeglut.

ok now change in application
1. Create a new C++ Console project in VS.
1a. In the Create Application Wizard, select Empty Project.

2a. On the menu bar, go to Project -> Properties.
2b. Go to Linker -> Input and copy and paste this line in the Additional Dependencies field.
opengl32.lib glu32.lib glut32.lib
3a. If you try to compile now, errors may still show up. You'll probably need to add directories for your header and lib files in Project/Solutions directories.
3b. Go to Tools -> Options. Expand the Project and Solutions section and select VC++ Directories. Make sure the dropdown box for 'Show directories for:' has 'Include files' selected.
4a. Add a new entry with C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL (or where your directory is)
The program should now compile

This should have helped you..njoy cheers

No comments:

Post a Comment