Visual C++ 6


Introduction

Display   Yes, this is actually a commercial product, not a variant of the C++ language. A lot of people have been confused by it's marketing-inspired, gimmicky title, even so far as to argue endlessly with me. Visual C++ is a brand of compiler, it is not a superset of the C++ language. Look at it this way: C++ is a car, and Visual C++ is a Mazda (a brand of car).


Obtainment

This is a commercial product that costs money. It can be purchased seperately, but also comes as a part of Microsoft Visual Studio 6. I suggest you try to find the stand alone version unless you want all that other crap too. You'll save some money. The Microsoft advertisements like to say that it's only a few dollars more for the whole package, but you have to think about what you're actually going to use. By the time you get around to using the other stuff, it'll be cheap as dirt or new products (or versions) will have replaced them.

Installation

For the purposes of teaching you C++ rather than a product, I will not be explaining the GUI (graphical user interface) of MSVC. It changes every stinking time they release a new one, making dependent books and tutorials defunct. Heck, I even only gurantee this for MSVC 6 because I don't know how much different older and newer versions are. These installation instructions are for making MSVC usable via the command line (i.e. in a console window).

  1. Most of the installation should be fairly self-explanatory. But you must make sure to install Visual C++ itself to the folder C:\MSVC\ for the purpose of these instructions. You'll see your chance in a setup dialog like this:

    Change Folder

    If the destination folder displayed is not C:\MSVC\ then click the "Change Folder..." button. In the dialog that pops up, type:

    C:\MSVC



  2. After you've installed MSVC. Open up the file C:\AUTOEXEC.BAT in a text editor and insert the following line at the top of the file:

    C:\MSVC\BIN\VCVARS32.BAT

  3. Restart your computer.


Build Program: From Single File

To compile a single C++ file into an executable, type the following:

cl file.cpp [enter]

You should replace "file.cpp" with the filename of your source file. This will produce an executable with the same base name, but with the extension ".exe".

Links

Visual C++ Start Page