How to use OpenGL or Glut in a program under Visual C++:
First, make sure that you've included all the necessary *.h files. You
need <GL/glut.h> for Glut; or <GL/gl.h> and <afxwin.h>,
and possibly <GL/glu.h> and/or <GL/glaux.h> for OpenGL.
Now comes the tricky bit. You have to let Visual C++ know that you want
it to consult all the necessary libraries. To do this, you first need to
go under the Build menu item and chose Settings.
A Project Settings dialog box will now pop up. You now need to select
the Link tab. Unfortunately, the Link tab is hiding. Click
the half-a-tab circled below...
...and the Link page will magically appear:
The Object/library modules section of this page which you are interested
in is circled in red above. Scroll to the end of this line and add the
necessary *.lib files to the list.
There are four libraries which you might need to add: opengl32.lib,
glu32.lib, glaux.lib, and glut.lib. Which of these
you need depends on the specific program, but since it doesn't hurt to
have extra libs listed, I suggest you add all four.