Skip to content

CMake and Visual Studio 6

This guide sets up the original Visual C++ 6 compiler for the GeneralsGameCode CMake build. The shared presets, options, targets, output paths, installation steps, and configuration-specific requirements are documented in the Building with CMake guide.

Download the Visual Studio 6.0 Portable archive and extract its Common and VC98 directories into:

C:\Program Files (x86)\Microsoft Visual Studio

The compiler environment script should then be located at:

C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.bat

If you install it elsewhere, replace this path in the commands below.

Important: Use Command Prompt (cmd.exe) for the terminal commands below, not PowerShell, Git Bash, or another shell. The VC6 environment must be activated again in every new Command Prompt instance.

Clone the repository:

Terminal window
git clone https://github.com/TheSuperHackers/GeneralsGameCode.git
cd GeneralsGameCode

Activate the VC6 environment:

Terminal window
call "C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.bat"

Verify that the compiler, CMake, and Ninja are available:

Terminal window
where cl
cl
cmake --version
ninja --version

cl should report Microsoft 32-bit C/C++ compiler version 12.

From the repository root, configure and build the VC6 Release preset:

Terminal window
cmake --workflow --preset vc6

See the Building with CMake guide for Debug and Profile builds, game and tool selection, individual targets, installation, and retail compatibility.

Run VCVARS32.bat again in the current Command Prompt. Confirm that where cl resolves to the VC6 CL.EXE, not a newer Visual Studio compiler.

VC6 has much smaller path-length limits than modern compilers. Move the repository closer to the drive root, such as C:\GeneralsGameCode, and configure it again.

Run VCVARS32.bat and check that INCLUDE and LIB contain the VC6 directories. If the wrong compiler was cached, reset the affected preset as described in the Building with CMake guide.

See the centralized VC6 Debug runtime requirements.