Wire up remaining DirectX SDK paths; build now succeeds

Verified full build with VC++ 2008 Express SP1 + Windows SDK v6.0A + DirectX
SDK (June 2010): 4 Projects succeeded, 0 failed (Release|Win32). Outputs:
Release\rpl4opt.exe, Release\RPL4TOOL.exe, lib\Munga_L4.lib, lib\DivLoader.lib.

Two projects referenced DirectX but were never repointed at $(DXSDK_DIR)
(they had no hardcoded path to replace earlier):

- DivLoader.vcproj: add "$(DXSDK_DIR)Include" to both compiler configs
  (was failing on D3DX9.h).
- RPL4TOOL.vcproj / RPL4TOOL VS2008.vcproj: add "$(DXSDK_DIR)Lib\x86" to the
  linker search path (was failing with LNK1181 on dinput8.lib).

.gitignore: ignore the build-output static libs that land in lib/
(Munga_L4.lib, DivLoader.lib); the dependency libs OpenAL32.lib and
libsndfile-1.lib stay tracked.

BUILD.md / docs/BUILD-NOTES.md: record the verified build, the CLI recipe,
and the DXSDK_DIR stale-environment gotcha.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-01 09:56:19 -05:00
co-authored by Claude Opus 4.8
parent f849415c02
commit 8d18ce0ee4
6 changed files with 84 additions and 9 deletions
+5
View File
@@ -40,6 +40,11 @@ ipch/
*.log *.log
rpl4.log rpl4.log
# Build-output static libs that land in lib/ (the two committed dependency
# libs, OpenAL32.lib and libsndfile-1.lib, stay tracked).
/lib/Munga_L4.lib
/lib/DivLoader.lib
# Stale Subversion metadata # Stale Subversion metadata
.svn/ .svn/
+43 -6
View File
@@ -4,6 +4,13 @@ This is the Win32 source for the pod-racing game **Red Planet**, built on the
in-house **MUNGA** engine and its **L4** (Win32 / DirectX 9) platform layer. in-house **MUNGA** engine and its **L4** (Win32 / DirectX 9) platform layer.
The code targets the Visual Studio 2005/2008 era and the legacy DirectX SDK. The code targets the Visual Studio 2005/2008 era and the legacy DirectX SDK.
> ✅ **Verified build (2026-07-01):** all 4 projects build clean (`Release|Win32`)
> with **Visual C++ 2008 Express SP1** + **Windows SDK v6.0A** (VS-bundled) +
> **DirectX SDK (June 2010)**. Outputs: `Release\rpl4opt.exe` (the game),
> `Release\RPL4TOOL.exe`, `lib\Munga_L4.lib`, `lib\DivLoader.lib`.
> Only compiler *warnings* remain (deprecated CRT calls, int→Scalar narrowing,
> benign `LNK4006`/`LNK4221` duplicate-symbol notes). See §7 for the CLI recipe.
--- ---
## 1. Requirements ## 1. Requirements
@@ -135,9 +142,39 @@ now builds it:
Checklist for a clean Express build: Checklist for a clean Express build:
1. Install **Visual C++ 2008 Express SP1**. 1. Install **Visual C++ 2008 Express SP1**.
2. Install the **Windows SDK 7.1** (for `WS2_32.lib`, `dbghelp.lib`, core Win32 2. Install the **DirectX SDK (June 2010)** and confirm `DXSDK_DIR` is set.
headers/libs that Express's bundled SDK subset may not fully cover). 3. Open `WinTesla.sln`, pick `Release|Win32`, build.
3. Install the **DirectX SDK** (already done — June 2010) and confirm `DXSDK_DIR`.
4. Open `WinTesla.sln`, pick `Release|Win32`, build. > The Windows SDK **v6.0A** that ships with VS2008 already provides `WS2_32.lib`
5. If the linker can't find `dbghelp.lib`, remove it from > and `dbghelp.lib`, so a separate Windows SDK 7.1 install was **not** needed in
`RP_L4` → Linker → Input → Additional Dependencies (it is unused). > the verified build. `dinput8.lib`/`dxguid.lib` come from the DirectX SDK.
---
## 7. Verified command-line build recipe
This is exactly what produced the verified build. The key gotcha: a shell opened
*before* the DirectX SDK set the machine-level `DXSDK_DIR` will not see it, so the
recipe sets it explicitly.
```bat
@echo off
call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
set "DXSDK_DIR=C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\"
cd /d C:\VWE\RP411
vcbuild /nologo /rebuild WinTesla.sln "Release|Win32"
```
Expected result: `4 Projects succeeded, 0 Projects failed`.
### DirectX SDK paths per project (all via `$(DXSDK_DIR)`)
For the build to find DirectX headers/libs, each project that touches DirectX
must reference the SDK through `$(DXSDK_DIR)`. This is now wired up as:
| Project | Include `$(DXSDK_DIR)Include` | Lib `$(DXSDK_DIR)Lib\x86` |
|---------|:---:|:---:|
| Munga_L4 | ✅ | ✅ |
| RP_L4 | ✅ | ✅ |
| RPL4TOOL | (not needed) | ✅ |
| DivLoader | ✅ | (static lib, no link) |
+2
View File
@@ -38,6 +38,7 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(DXSDK_DIR)Include&quot;"
Optimization="0" Optimization="0"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@@ -99,6 +100,7 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(DXSDK_DIR)Include&quot;"
RuntimeLibrary="2" RuntimeLibrary="2"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
+1 -1
View File
@@ -64,7 +64,7 @@
AdditionalOptions="/FORCE:MULTIPLE" AdditionalOptions="/FORCE:MULTIPLE"
AdditionalDependencies="WS2_32.lib Munga_l4.lib dinput8.lib dxguid.lib" AdditionalDependencies="WS2_32.lib Munga_l4.lib dinput8.lib dxguid.lib"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="..\lib" AdditionalLibraryDirectories="&quot;$(DXSDK_DIR)Lib\x86&quot;;..\lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="1" SubSystem="1"
RandomizedBaseAddress="1" RandomizedBaseAddress="1"
+2 -2
View File
@@ -63,7 +63,7 @@
AdditionalOptions="/FORCE:MULTIPLE" AdditionalOptions="/FORCE:MULTIPLE"
AdditionalDependencies="Munga_l4.lib libsndfile-1.lib WS2_32.lib dinput8.lib dxguid.lib" AdditionalDependencies="Munga_l4.lib libsndfile-1.lib WS2_32.lib dinput8.lib dxguid.lib"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="..\lib" AdditionalLibraryDirectories="&quot;$(DXSDK_DIR)Lib\x86&quot;;..\lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="0" SubSystem="0"
TargetMachine="1" TargetMachine="1"
@@ -139,7 +139,7 @@
AdditionalOptions="/FORCE:MULTIPLE" AdditionalOptions="/FORCE:MULTIPLE"
AdditionalDependencies="Munga_l4.lib libsndfile-1.lib WS2_32.lib dinput8.lib dxguid.lib" AdditionalDependencies="Munga_l4.lib libsndfile-1.lib WS2_32.lib dinput8.lib dxguid.lib"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="../lib" AdditionalLibraryDirectories="&quot;$(DXSDK_DIR)Lib\x86&quot;;../lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="1" SubSystem="1"
OptimizeReferences="2" OptimizeReferences="2"
+31
View File
@@ -118,6 +118,37 @@ Changes:
`CString` in this file is **MUNGA's own** class (`MUNGA/CSTR.h`), not ATL's, so `CString` in this file is **MUNGA's own** class (`MUNGA/CSTR.h`), not ATL's, so
dropping the ATL headers does not affect it. dropping the ATL headers does not affect it.
### 2.5 Wire remaining DirectX SDK paths (build now succeeds)
The first real build attempt surfaced two projects that referenced DirectX but
were never repointed at `$(DXSDK_DIR)` (they had no hardcoded path to replace in
§2.3):
- **DivLoader** failed to compile (`VGCDivLoader.h`: cannot open `D3DX9.h`).
Added `AdditionalIncludeDirectories="$(DXSDK_DIR)Include"` to both compiler
configurations.
- **RPL4TOOL** failed to link (`LNK1181: cannot open input file 'dinput8.lib'`).
Added `$(DXSDK_DIR)Lib\x86` to `AdditionalLibraryDirectories` in both
`RPL4TOOL.vcproj` and `RPL4TOOL VS2008.vcproj`.
After these edits: **`4 Projects succeeded, 0 Projects failed`** for
`Release|Win32`.
> **Environment gotcha:** the DirectX SDK installer sets `DXSDK_DIR` at machine
> scope, but any shell already running when it was set won't inherit it. The
> first build failed on `D3DX9.h` purely because the build shell had an empty
> `DXSDK_DIR`; setting it explicitly in the build script fixed it. See the CLI
> recipe in [BUILD.md](../BUILD.md) §7.
### 2.6 Build outputs kept out of git
The Release build writes `Munga_L4.lib` and `DivLoader.lib` into the tracked
`lib/` directory (that is their configured output path). These are build
artifacts — `Munga_L4.lib` alone is ~200 MB — and are now git-ignored by name.
The two genuine dependency libs in `lib/` (`OpenAL32.lib`, `libsndfile-1.lib`)
remain tracked. Executables and per-project `Release/`/`Debug/` intermediate
folders were already covered by `.gitignore`.
--- ---
## 3. Project reference data ## 3. Project reference data