From 6c8650fa98d9112ed9a48afad262f524a8bde80e Mon Sep 17 00:00:00 2001 From: RT Date: Sun, 9 Aug 2026 16:08:33 -0500 Subject: [PATCH] mw4print: declare the -debug globals in mw4print.cpp Release build failed: mw4print.cpp(60) : error C2065: 'g_bDebugLog' : undeclared identifier mw4print.cpp(61) : error C2065: 'DbgLog' : undeclared identifier 3256c103 added the -debug switch and put both symbols in mw4dummy.h, but mw4dummy.cpp is #included into ChildView.cpp rather than compiled on its own, and mw4print.cpp is a separate translation unit including only stdafx.h, mw4print.h and MainFrm.h. It therefore saw neither declaration. ChildView.cpp and recscore.cpp compiled because they pull in mw4dummy.h directly. Declared locally rather than including mw4dummy.h. That header is a game-source shim: it #defines MString to CString, Scalar to float, Verify and gosASSERT to nothing, and declares stub ReplicatorID / MemoryStream classes plus the Adept damage-type enum. It exists so game sources can be compiled into the printer, and it has no business reaching the MFC application code. mw4print.cpp already reached AssetsDirectory1 the same way, so this follows the file's own convention rather than introducing one. recscore.cpp also calls DbgLog and is listed in the .dsp, but it carries "# PROP Exclude_From_Build 1" and is only ever compiled through ChildView.cpp, so mw4print.cpp was the single gap. Co-authored-by: Claude Opus 5 (Anthropic) Co-authored-by: GitHub Copilot --- Gameleap/code/mw4/Code/mw4print/mw4print.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Gameleap/code/mw4/Code/mw4print/mw4print.cpp b/Gameleap/code/mw4/Code/mw4print/mw4print.cpp index d4a54d61..50a371da 100644 --- a/Gameleap/code/mw4/Code/mw4print/mw4print.cpp +++ b/Gameleap/code/mw4/Code/mw4print/mw4print.cpp @@ -25,7 +25,13 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMW4PrintApp construction + +// Defined in mw4dummy.cpp, which is compiled into ChildView.cpp rather than on its own. +// Declared here instead of including mw4dummy.h: that header is a game-source shim that +// redefines MString, Scalar and Verify, and must not reach the MFC application code. extern char AssetsDirectory1[MAX_PATH]; +extern bool g_bDebugLog; +void DbgLog(const char* fmt, ...); CMW4PrintApp::CMW4PrintApp() {