How to install FreeGLUT for Visual Studio 2012

FreeGLUT is an open-source library implementation of GLUT. These steps helped me install and use FreeGLUT with both Visual Studio 2012 and Visual Studio Express 2012 for Windows Desktop:

  1. Download a stable release of FreeGLUT from its webpage.

  2. Unzip the downloaded FreeGLUT file to a directory. Inside it, go to VisualStudio\2012 directory and open the freeglut.sln Visual Studio solution file. It opens in Visual Studio.

  3. In the toolbar, choose the Solution Configuration as Release. In Solution Explorer, right-click on the freeglut project and choose Build. It should build successfully.

  4. Create a new directory named GL in C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include Copy all the header files in include\GL of FreeGLUT to this new directory.

  5. Copy freeglut.lib from lib\x86 to C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib

  6. You want to use FreeGLUT to create OpenGL programs. After you build an OpenGL program, copy freeglut.dll from lib\x86 to the directory that contains the exe file of this OpenGL program. Your program should now execute successfully.

Tried with: FreeGLUT 2.8.1, Visual Studio 2012, Visual Studio 2012 for Windows Desktop and Windows 8 x64

7 thoughts on “How to install FreeGLUT for Visual Studio 2012

    1. Erick Mendonca: Please check if you are creating a console application or a Windows application. This error usually happens in a mismatch of those cases.


    1. Daniel: This means that Visual Studio is not able to find freeglut.lib file while linking your program. Check if the lib file has been placed in a location where Studio can find it.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.