-
Notifications
You must be signed in to change notification settings - Fork 78
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
- CLion
- Source Code of the project cloned from the TheSuperHackers repository
For simplicity, this guide assumes the user will be using the default install folder for Visual Studio 6.0 Portable:
C:\Program Files (x86)\Microsoft Visual Studio\
-
Open the cloned folder in CLion and 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.
-
-
In the CMake profiles, enable the profiles you want to use. The available workflow presets are:
-
vc6
- Release build -
vc6-debug
- Debug build -
vc6-internal
- Internal build -
vc6-profile
- Profile build
For detailed information about each build configuration and their specific purposes, see the Build Configurations Overview.
-
-
In the target application options, do the following:
- Set Program arguments with your preferred command line arguments, such as
-win
,-quickstart
, etc. - Set Working directory to the game directory.
- Check the Run as administrator option.
- In the Before launch section, add a new install step.
- To avoid duplicate builds, remove the Build step.
- Save the configuration, and you are ready to build and run the project.
- Set Program arguments with your preferred command line arguments, such as
- Now, click the Build button in CLion, or click Install in the build menu.
- CLion will start the build/install process using the VC6 (x86) toolchain.
- Once the build is successfully completed, an executable file will be generated and installed in the game directory.
- Working with VC6 requires some adjustments, so it’s a good idea to verify that the toolchain is working properly.
- You can add Release and Debug profiles in CLion to build the project in different configurations.
- 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
- 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