A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
Hello @Sid Kraft ,
Thanks for your question.
It sounds like the compiler cannot find GL/glut.h because Visual Studio has not been told where the freeglut files are located on your machine. Downloading the package is the first step - the paths still need to be added to the project settings.
First, please check whether the file actually exists on your machine. After extracting freeglut, you should see:
<your_freeglut_folder>\include\GL\glut.h
If that file isn't present, you may have downloaded the source package rather than a pre-built version. In that case, you might find the following package easier to use with Visual Studio: freeglut
Also, make sure the freeglut libraries match the platform you're building for in Visual Studio:
- x86 build → use the libraries from the lib\x86 folder
- x64 build → use the libraries from the lib\x64 folder
Mixing them usually results in linker error LNK1112.
For the project settings, you'll normally need all three of the following:
- C/C++ → General → Additional Include Directories. Please add
<your_freeglut_folder>\include. This allows the compiler to locate glut.h. - Linker → General → Additional Library Directories. Please add
<your_freeglut_folder>\lib\x64(or x86, depending on your build target). This tells Visual Studio where to find the .lib files. - Linker → Input → Additional Dependencies. Please add
freeglut.lib;opengl32.lib;glu32.lib. This tells the linker which libraries your project needs.
Regarding your question about separators, Visual Studio expects multiple entries to be separated by semicolons (;). If you're unsure, click Edit... next to the field, and Visual Studio will let you add each entry on a separate line.
One other thing to watch for: even after the project builds successfully, Windows may report that freeglut.dll is missing when you run the application. If that happens, copy freeglut.dll from the appropriate bin\x64 or bin\x86 folder into the same folder as your compiled .exe.
While this is a non-Microsoft link, it’s official Nuget documentation and is safe to visit.
I hope this addresses your question. If this response was helpful, please consider following the guidance to provide feedback. Thank you.