Using Visual C++

Building a simple OpenGL application

Files and directories created by Visual C++

Keeping a UNIX-like environment


Building a simple OpenGL application

The following steps describe how to write and compile a simple OpenGL application in the Visual C++ environment.
They assume that the OpenGL and glut libraries have been properly installed. The example was tested with Microsoft Visual C++ v5.0, although I expect that any version after and including v4.0 to work identically.

Files and directories created by Visual C++

 Visual C++ produces a multitude of extra files as it compiles and links. Note, however, that as long as your source files (*.cpp. *.h) and the workspace and project files (*.dsw, *.dsp) exist, the rest can be regenerated by Visual C++. Thus, the rest of the file types are intermediate files which can be deleted.
 
.bsc Browse information file. This information is used to provide information such as where a symbol is first defined or referenced. It is produced from the .sbr file.
.dsw  Project workspace file. Stores information at the workspace level. Other associated files are also created, including a project file (.dsp) for building a single project or subproject, and a workspace options file (.opt) to store project workspace settings. 
.dsp Project file. See .dsw.
.exe Program executable
.ilk Incremental link file. Stores information required for incremental linking.
.ncb Network control block (?). Purpose ?
.obj Object files. Equivalent to unix '.o' files.
.opt Workspace options file. Contains local cosmetic settings, which include information about the local organization and appearance of the project workspace using your hardware and configuration. 
.pch pre-compiled headers for the project, which allows for faster compiles
.pdb Program database. Holds debugging and project state information. Provides the information needed for incremental linking of debug program versions.
.plg ??
.sbr Stores symbolic information about each .obj file.
vc50.idb incremental information for vc50.pdb (?)
vc50.pdb Stores all debugging information for the individual .obj files. 
 
Visual C++ makes a distinction between Debug and Release Configurations of code. Each of these configurations has its own corresponding subdirectory where the object, executable, and intermediate files are stored. The use of the Debug configuration (which is the default) is assumed in this document.

Keeping a UNIX-like Environment

It is also possible to edit and compile code without being in the Visual C++ environment. I recommend installing a version of emacs for this. The following URL is a good reference for running and using GNU Emacs under Windows 95/98/NT. Visual C++ comes with nmake, which is quite similar to UNIX make in many respects. The following makefile, which we shall refer to as Makefile.win, will work for the simple OpenGL example discussed earlier: Emacs is recommended for executing your make because it gives you a scrollable window, whereas the regular MSDOS console window does not have any scroll capability, incredibly enough.