Installing GLUT on Visual Studio 2010
August 12, 2010 7 Comments
I decided to do this write up for both myself and others who might be installing GLUT in Visual Studio 2010. I’ll include pictures if anyone requests it, but I think this is fairly straight forward.
First thing to do would be to place all the files in their correct directories.
glut.h: ‘C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\GL\’
glut32.lib: ‘C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\’
For 64-bit machines, you will want to do this.
1. Under Visual C++, select Empty Project.
2. Go to Project -> Properties. Select Linker -> Input then add the following to the Additional Dependencies field:
NOTE: If you will be also installing GLEW be sure to place, “#include <GL/glew.h>”, before the include for GLUT. Also place “glewInit();” after your “glutCreateWindow”.
NOTE: This is where things differ a bit between Visual Studio 2010 and the previous versions. In the previous versions we would just add into the VC++ Directories, but they have since done away with this and replaced it with Property Sheets.
Go here to learn about Property Sheets.
This link discusses VC++ Directories in VS2010.
3. Go to View -> Property Manager.
4. Right click and Add New Project Property Sheet. I just named my new Project Property Sheet as ‘GLUT’ and so I will be referring to our Property Sheet as ‘GLUT’.
5. You should now see ‘GLUT’ under Microsoft.Cpp.Win32.user in both the Debug and Release section of the Property Manager.
6. Right-click ‘GLUT’ select Properties, then select VC++ Directories.
7. Select Include Directories and choose ‘Edit…’
8. Either enter this directory ‘C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\GL’ or browse to it.
9. Everything should work now! Please leave a comment if it worked or ran across any problems.
For future projects, you would need to select ‘Add Existing Project Sheet’ in the Project Manager in order to get GLUT working. You can also edit the Microsoft.Cpp.Win32.user sheet and add GLUT to the VC++ Directories, but then GLUT would be applied to every project you create.