-
Notifications
You must be signed in to change notification settings - Fork 81
build_with_clion_vc6_toolchain
This guide shows how to configure CLion to work with the Visual Studio 6.0 toolchain, maintaining compatibility with the original compiler from the game's development era. To compile the source code for Command & Conquer: Generals and Zero Hour using the CLion IDE, follow the steps outlined below.
-
Visual Studio 6.0 Portable
See the Visual Studio 6.0 Portable installation instructions for setup details.
- CLion
This guide assumes the user uses the default installation folder for Visual Studio 6.0 Portable:
C:\Program Files (x86)\Microsoft Visual Studio\
-
Clone the source code from TheSuperHackers:
git clone https://github.com/TheSuperHackers/GeneralsGameCode.git
Alternatively, you can clone the repository directly from within CLion.
-
Open the cloned folder in CLion.
-
In CLion, go to File → Settings → Build, Execution, Deployment → Toolchains.
-
Add a new Toolchain by clicking the + button.
-
Select System as the type (not Visual Studio).
-
Rename the toolchain to Visual Studio 6.
-
Next to the toolchain name, add the environment file by clicking the + button and pointing to the following file:
C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT
Warning: Make sure to change the file extension from
.BAT
to.bat
(lowercase) in the path to the environment file in the CLion toolchains window, otherwise CLion may have issues detecting the environment for some reason. -
Set the paths for the tools:
-
Build Tool: Choose the
NMAKE.EXE
file from VC6. For example:C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\NMAKE.EXE
-
C Compiler: The
cl.exe
should be detected automatically. If not, set it manually to:C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\cl.exe
-
C++ Compiler: The
cl.exe
will also be detected automatically.
-
-
To configure the CMake profiles, proceed with the following steps:
- Go to File → Settings → Build, Execution, Deployment → CMake. (should open automatically after opening the folder containing the cloned source code)
- Disable the default
Debug
profile. - Enable
vc6
- Release build - Enable
vc6-debug
- Debug build - Enable
vc6-profile
- Profile build
For detailed information about each build configuration and their specific purposes, see the Build Configurations Overview.
-
In the Run/Debug Configurations dropdown, select the target game:
z_generals
(Zero Hour) org_generals
(Generals). -
Open the same dropdown, then for the target game you just selected, click the 3 dots on the right, then Edit...
Note: This step must be repeated for both
z_generals
andg_generals
targets.-
Set Program arguments with your preferred command line arguments, such as
-win
,-quickstart
, etc. -
Set Executable to the path of your game install plus the built executable name, for example:
C:\Program Files (x86)\Command & Conquer Generals Zero Hour\generalszh.exe (for Zero Hour) or C:\Program Files (x86)\Command & Conquer Generals Zero Hour\generalsv.exe (for Generals)
This ensures that the game starts correctly after clicking the run button in CLion.
-
Set Working directory to the game directory.
-
Check the Run as administrator option.
-
To avoid duplicate builds, remove the Build step.
-
In the Before launch section, add a new install step.
-
Save the configuration, and you are ready to build and run the project.
-
Click Run on the toolbar, or build the project and run the executable from the game directory.
⚠️ Debug Build Requirements: To run a debug build of the game, you need to have
the following two files in the game directory alongside the built executable:
MSVCRTD.DLL
Microsoft Visual C++ Runtime Library (Debug)MSVCIRTD.DLL
Microsoft Visual C++ Internationalization Runtime Library (Debug)
- Working with VC6 requires some adjustments, so it’s a good idea to verify that the toolchain is working properly.
- Administrator rights may be required to run VC6 tools, so run CLion as an administrator if needed.
- How to Get Involved
- How to Contribution
- Replays for testing
- In-Game Debug Commands
- Community forks
- License
- Credits
- Changelog
- FAQ
- Known Issues
- Contact & Community
-
Visual Studio 6 Guides:
-
Visual Studio 2022 Guides:
- DirectX
- STLport
- Max4SDK
- NVASM
- Benchmark
- MilesSoundSystem
- Bink
- SafeDisk
- Asimp3
- GameSpy
- ZLib
- LZHCompress