Using GLUT with Visual C++ Express Edition

Ashwin Nanjappa picture Ashwin Nanjappa · Aug 18, 2008 · Viewed 16.5k times · Source

What are the basic steps to compile an OpenGL application using GLUT (OpenGL Utility Toolkit) under Visual C++ Express Edition?

Answer

Ashwin Nanjappa picture Ashwin Nanjappa · Aug 18, 2008
  1. If you don't have Visual C++ Express Edition (VCEE), download and install VCEE.
  2. The default install of Visual C++ Express Edition builds for the .Net platform. We'll need to build for the Windows platform since OpenGL and GLUT are not yet fully supported under .Net. For this we need the Microsoft Platform SDK. (If you're using an older version of VCEE, download and install the Microsoft Platform SDK. Visual C++ Express Edition will need to be configured to build for Windows platform. All these instructions are available here.)
  3. If you don't have GLUT, download and unzip Nate Robin's Windows port of GLUT.
  4. Add glut.h to your Platform SDK/include/GL/ directory
  5. Link the project with glut.lib. (Go to VCEE Project Properties -> Additional Linker Directories and add the directory which has glut.lib.
  6. Add glut.dll to the Windows/System32 directory, so that all programs using GLUT can find it at runtime.

Your program which uses GLUT or OpenGL should compile under Visual C++ Express Edition now.