Solution for Visual Studio 2022
Install vcpkg: https://learn.microsoft.com/en-us/vcpkg/get_started/get-started?pivots=shell-powershell
Add VCPKG_ROOT = PATH_TO_VCPKG to your environment variables. Add VCPKG_ROOT to your PATH env variable
In Visual Studio, in the solution explorer pane, right click on the C/C++ project name, select Properties from the dropdown. Select the Debug configuration. In the C/C++ tab, edit "Additional Include Directories", and add %VCPKG_ROOT%\packages\freeglut_x64-windows\include. In the linker\input tab, add %VCPKG_ROOT%\packages\freeglut_x64-windows\debug\lib\freeglutd.lib
copy %VCPKG_ROOT%\packages\freeglut_x64-windows\debug\bin\freeglutd.dll to the x64\Debug directory of your project
Compile and run