Compilation and Installation Instructions for OpenGL on Windows
A. Compilation Steps for Visual C++ (VC++) 20xx (similar for various VC++ versions; we use Visual Studio/VC++ 2019 below as an example):
To compile, click on Build -> Build [project name]
(or Rebuild [project name]).
To run, click on Debug -> Start Without Debugging (or Ctrl+F5).
(2)
(The following was an issue for VC++ 2017 but has been
fixed in VC++ 2019. So just check to make sure that it is set up as
desired.)
In case the console window disappears after the program stops, any
"debugging messages" printed to the console cannot be seen. To fix
and have the console window stay (this is strongly
recommended), do as follows:
As in Step 6 above, do Debug -> [project name] Debug Properties, then
below Configuration Properties, select Linker ->
System. In the right window, left click Subsystem to
activate the field and left click the arrow on the right, and
select Console (/Subsystem:Console), then click OK.
B. Installation on Your Own Computer:
(1) You need to have the VC++ software installed. A free
download version, Visual Studio Community 2019, is available
and can be downloaded directly from the course web
site
here for your
convenience. Save and run it to install.
(2) You also need to get the FreeGLUT package (available
from the course web site
here) and the GLEW
package (available from the course web site
here). After unzipping the FreeGLUT and GLEW packages, get the
following files (for the 64-bit version; the 32-bit version can be
obtained similarly): (1) From FreeGLUT, get bin/x64/freeglut.dll,
lib/x64/freeglut.lib, and include/GL/*.h (they are glut.h, freeglut.h,
freeglut_ext.h, freeglut_std.h). (2) From GLEW, get
bin/Release/x64/glew32.dll, lib/Release/x64/glew32.lib,
include/GL/glew.h, and include/GL/wglew.h. Put these files to the
specified folders as below:
1. glut.h, freeglut.h, freeglut_ext.h, freeglut_std.h, glew.h,
wglew.h:
Go to a folder similar to this: 2. freeglut.lib, glew32.lib:
Go to a folder similar to this: 3. freeglut.dll, glew32.dll:
Go to this folder: C:\Windows\System32\, and put these new
*.dll files there. Make sure that this folder is on your PATH.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\gl\,
and put these new *.h files there.
(This folder could also be obtained as below.
(a) In Visual Studio, go to "Debug" -> "[project name] Debug Properties"
-> "Configuration Properties" -> "VC++ Directories" / "Include
Directories"; or (b) Search for the folder containing
"gl.h" and "glu.h" (some letters may be in upper case).)
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64\,
and put these new *.lib files there.
(This folder could also be obtained as below.
(a) In Visual Studio, go to "Debug" -> "[project name] Debug Properties"
-> "Configuration Properties" -> "VC++ Directories" / "Library Directories"; or
(b) Search for the folder containing "opengl32.lib" and "glu32.lib"
(some letters may be in upper case).)
(This folder could also be obtained by searching for the folder containing
"opengl32.dll" and "glu32.dll" (some letters may be in upper case).)