Skip to content

Commit 3e4d951

Browse files
authored
Updated the guide to fix spelling and grammar errors, (#48)
clarify a few points, update outdated build preset names, and add a note about using the Windows Command Prompt.
1 parent 319cde7 commit 3e4d951

File tree

1 file changed

+62
-49
lines changed

1 file changed

+62
-49
lines changed

SourceCode/Builds/build_with_msvc6.md

Lines changed: 62 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,92 @@
1-
# Compile Command & Conquer Zero Hour with VC6
1+
# Compile Command & Conquer Generals And Zero Hour with VC6
22

3-
To compile the source code for **C&C Generals** and **Zero Hour**, follow the steps
4-
outlined below. This process is still in the early stages of development, and ongoing
5-
efforts may lead to additional tools being compiled from the source code. The focus
6-
here is solely on compiling the main executable, which can then be placed into the
7-
game directory and used to start the game with the newly compiled binary.
8-
9-
This process utilizes the original compiler from the game's development era to ensure
10-
compatibility. The available source code specifically compiles **zerohour.exe**.
3+
This guide shows how to compile the source code for **Command & Conquer: Generals** and **Zero Hour**. To compile
4+
the source code, follow the steps outlined below. This process is still in the early stages of development, and
5+
ongoing efforts may lead to additional tools being compiled from the source code. The focus here is solely on
6+
compiling the main executable, which can then be placed into the game directory and used to start the game with
7+
the newly compiled binary. This process utilizes the original compiler from the game's development era to ensure
8+
compatibility.
119

1210
## Intended Audience
1311

14-
This guide is intended for software developers, starting from a beginner level. You
15-
should be able to write programs and execute them. Familiarity with command-line
16-
interfaces and configuring environment variables when necessary is required.
12+
This guide is intended for software developers, starting from a beginner level. You should be able to
13+
write programs and execute them. Familiarity with command-line interfaces and configuring environment
14+
variables when necessary is required.
1715

18-
Even if you do not know C++, you should still be able to compile the source code.
19-
However, a basic understanding of how C++ is compiled is necessary. This includes
20-
knowing what the **compiler** and **linker** do, as well as being able to
21-
interpret error messages and troubleshoot them effectively.
16+
Even if you do not know C++, you should still be able to compile the source code. However, a basic
17+
understanding of how C++ is compiled is necessary. This includes knowing what the **compiler** and
18+
**linker** do, as well as being able to interpret error messages and troubleshoot them effectively.
2219

2320
## Prerequisites
2421

25-
Download the following binary and software and have them ready in a project folder.
22+
Download the following binaries and software and have them ready in a project folder.
23+
24+
- [Visual Studio 6.0 Portable](https://github.com/itsmattkc/MSVC600)
25+
- [CMake 3.31.6](https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-windows-x86_64.msi) or [newer](https://cmake.org/download/#latest)
26+
- [Git](https://git-scm.com/downloads)
2627

27-
- Visual Studio 6.0 Portable [Link](https://github.com/itsmattkc/MSVC600)
28-
- CMake 3.31.6 [Link](https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-windows-x86_64.msi)
29-
- Git [Link](https://git-scm.com/downloads)
28+
> For simplicity, this guide will use the installers for Git and CMake and assumes the user will use the
29+
default install folder for Visual Studio 6.0 Portable.
3030

3131
## Installing your build environment
3232

3333
Installation of tools and software that are needed for compilation.
3434

3535
### Install Visual Studio 6
3636

37-
- Download the portable Visual Studio 6 as ZIP file from GitHub.
38-
- Extract the contents and put them in the default install folder.
39-
- Installation folder: `C:\Program Files (x86)\Microsoft Visual Studio\`
37+
- Download the portable Visual Studio 6 as a ZIP file from GitHub.
38+
- Extract the common and VC98 folders from the downloaded archive to the default install folder.
39+
- Default installation folder: `C:\Program Files (x86)\Microsoft Visual Studio\`
4040

41-
> Alternatively you can use the VC6 setup from Archive.org
41+
> Alternatively, you can use the VC6 setup from Archive.org.
4242
4343
### Install CMake
4444

45-
- Run the installer for CMake
46-
- Keep the defaults during setup wizard
45+
- Run the installer for CMake.
46+
- Enable the option to add CMake to the system path during the setup wizard.
4747

4848
### Install Git
4949

50-
- Run the git installer
51-
- Keep the defaults during setup wizard
50+
- Run the Git installer.
5251

5352
## Clone
5453

55-
Clone the code from TheSuperHackers
54+
Clone the code from TheSuperHackers:
5655

57-
`git clone https://github.com/TheSuperHackers/GeneralsGameCode.git`
56+
``` shell
57+
git clone https://github.com/TheSuperHackers/GeneralsGameCode.git
58+
```
5859

59-
`cd GeneralsGameCode`
60+
``` shell
61+
cd GeneralsGameCode
62+
```
6063

6164
## Compilation
6265

63-
This steps you need to repeat every time after a reboot of your computer.
66+
> Use the Windows Command Prompt aka CMD (not PowerShell, Git Bash, etc.) to run the commands.
67+
Otherwise, you will receive an error when building the source code.
6468

6569
### Option 1: Activate your VS6 Compiler Environment
6670

67-
Execute the setup build environment script. In your cmd type this. (assuming default installation path)
71+
> This needs to be done for each new instance of the CMD from which you wish to run build commands.
6872
69-
`"C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.bat"`
73+
Execute the setup build environment script. In your CMD, type this (assuming the default installation path):
74+
75+
``` shell
76+
"C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.bat"
77+
```
7078

7179
### Option 2: Manually set your VS6 Compiler Environment
7280

73-
`<VS6_INSTALL_PATH>`: Where you have put your vs6 installation path.
81+
> These steps need to be repeated every time after a reboot of your computer.
82+
83+
`<VS6_INSTALL_PATH>`: Where you have installed VS6.
84+
7485
`<PROJECT_FOLDER>`: Where you have the source code project.
7586

76-
PATH
87+
#### Path
7788

78-
```shell
89+
``` shell
7990
C:\<VS6_INSTALL_PATH>\VB98;
8091
C:\<VS6_INSTALL_PATH>\VC98\Bin;
8192
C:\<VS6_INSTALL_PATH>\VC98\Lib;
@@ -84,12 +95,12 @@ C:\<VS6_INSTALL_PATH>\Common\tools;
8495
C:\<VS6_INSTALL_PATH>\Common\MSDev98\Bin
8596
```
8697

87-
Environment Variables
98+
#### Environment Variables
8899

89-
```shell
100+
``` shell
90101
set LIB=C:\<VS6_INSTALL_PATH>\VC98\Lib;^
91102
C:\<VS6_INSTALL_PATH>\VC98\MFC\Lib;^
92-
C:\<PPROJECT_FOLDER>\build\vc6
103+
C:\<PROJECT_FOLDER>\build\vc6
93104

94105
set INCLUDE=C:\<VS6_INSTALL_PATH>\VC98\ATL\Include;^
95106
C:\<VS6_INSTALL_PATH>\VC98\Include;^
@@ -104,27 +115,29 @@ set MSVCDir=C:\<VS6_INSTALL_PATH>\VC98
104115

105116
### Build the project
106117

107-
Run the following command by the type of build you want to create.
118+
Run the following command based on the type of build you want to create:
108119

109120
- `cmake --workflow --preset vc6` for a release build.
110-
- `cmake --workflow --preset vc6dgb` for a debug build.
111-
- `cmake --workflow --preset vc6int` for an internal build.
112-
- `cmake --workflow --preset vc6prof` for a profile build.
121+
- `cmake --workflow --preset vc6-debug` for a debug build.
122+
- `cmake --workflow --preset vc6-internal` for an internal build.
123+
- `cmake --workflow --preset vc6-profile` for a profile build.
113124

114125
You will find a bunch of files in `build\vc6\<game name>` and a file called `generalszh.exe` or `generalsv.exe`.
115126

127+
For detailed information about each build configuration and their specific purposes, see the [Build Configurations Overview](https://github.com/TheSuperHackers/GeneralsGameCode/wiki/build_configuration).
128+
116129
### Install the game executable
117130

118-
Run `cmake --install build\<vc6 build type>`, this will copy the executable to the retail game directory, or you can
119-
copy it manually.
131+
Run ```cmake --install build\<vc6 build type>```, this will copy the executable to the retail game directory,
132+
or you can copy it manually.
120133

121134
## Troubleshooting
122135

123136
### Error: "too long"
124137

125-
- The compiler failed because the total path length for **lib** and **include** exceeded the limit for **VS6**.
126-
- Your only option is to move your project and dependencies **closer to the root of your drive** or rename
127-
folders in your project to shorter names.
138+
- The compiler failed because the total path length for **lib** and **include** exceeded the limit for **VS6**.
139+
- Your only option is to move your project and dependencies **closer to the root of your drive** or
140+
rename folders in your project to shorter names.
128141

129142
### Error: "could not find X.h file"
130143

0 commit comments

Comments
 (0)