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.
Requirements
Section titled “Requirements”- Windows
- Visual Studio 6.0 Portable
- Git
- CMake 3.25 or newer, added to
PATH - Ninja, added to
PATH
Install Visual C++ 6
Section titled “Install Visual C++ 6”Download the Visual Studio 6.0 Portable archive and extract its Common and VC98 directories into:
C:\Program Files (x86)\Microsoft Visual StudioThe compiler environment script should then be located at:
C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.batIf you install it elsewhere, replace this path in the commands below.
Clone the source
Section titled “Clone the source”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:
git clone https://github.com/TheSuperHackers/GeneralsGameCode.gitcd GeneralsGameCodeActivate the compiler
Section titled “Activate the compiler”Activate the VC6 environment:
call "C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.bat"Verify that the compiler, CMake, and Ninja are available:
where clclcmake --versionninja --versioncl should report Microsoft 32-bit C/C++ compiler version 12.
From the repository root, configure and build the VC6 Release preset:
cmake --workflow --preset vc6See the Building with CMake guide for Debug and Profile builds, game and tool selection, individual targets, installation, and retail compatibility.
Troubleshooting
Section titled “Troubleshooting”The compiler is not found
Section titled “The compiler is not found”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.
A path is too long
Section titled “A path is too long”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.
A header or library is missing
Section titled “A header or library is missing”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.
A VC6 Debug build does not start
Section titled “A VC6 Debug build does not start”See the centralized VC6 Debug runtime requirements.