# Compiling OpenGL Progams at Home Using Visual Studio

Windows does not include GLUT standard, like the lab machines in MLH 301 do. Thus, getting your OpenGL programs to compile and run at home is slightly more difficult. However by following the following steps, you should be able to figure out how to make it work:

2. Unzip the file.
3. Put the file “glut32.dll” into the system path.
• This can be in the same directory as your executable file.
• On Windows XP or earlier, this can be in “C:\WINDOWS\system32”
• Or you can create a directory like “C:\DLLs”, put the file in this directory and change your system path to include this new directory.
• Do this by opening Control Panel -> System, clicking on “Advanced System Settings”, followed by “Environment Variables”, and editing the “Path” variable.
4. Put the file “glut.h” into the standard Visual C++ include directoy
• (For Visual Studio 2010, this should be: “C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\gl”)
• (For Visual Studio 2008, this should be: “C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\gl”)
• (For Visual Studio 2005, this should be: “C:\Program Files\Microsoft Visual Studio.NET\Vc7\PlatformSDK\Include\gl”)
• You’ve got the right directory if you see a copy of “gl.h”
5. Put the file “glut32.lib” into the standard Visual C++ library directory
• (For Visual Studio 2010, this should be: “C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib”)
• (For Visual Studio 2008, this should be: “C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib”)
• (For Visual Studio 2005, this should be: “C:\Program Files\Microsoft Visual Studio.NET\Vc7\PlatformSDK\lib”)
• There should be lots of .lib files here, including “opengl32.lib” and “glu32.lib”.
• Menu: “Project -> (your-project-name) Properties”
• Tab: “Configuration Properties -> Linker -> Input”