From 534cef626e9fd3ae24b045dcdedc03b8150b9ac1 Mon Sep 17 00:00:00 2001 From: Petru Conduraru Date: Sun, 19 Jul 2026 23:40:15 +0300 Subject: [PATCH] win: document LNK1248 causes and the USE_CCACHE escape hatch Building IfcGeom with many schemas can exceed MSVC's 4GB image size limit in two ways reported in issue 7461: the /Z7 embedded debug format that ccache requires, and /GL whole-program optimization in the schema mappings. The first has a configure-time switch and the second is now handled automatically, but neither was discoverable from the Windows build documentation. Generated with the assistance of an AI coding tool. --- win/readme.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/win/readme.md b/win/readme.md index 539ba9db1e..0d7df7cc12 100644 --- a/win/readme.md +++ b/win/readme.md @@ -119,3 +119,22 @@ Directory Structure \---patches - Contains patches for the dependencies \---utils - Contains various utilities for the build scripts ``` + +Troubleshooting +--------------- + +### fatal error LNK1248: image size exceeds maximum + +Building `IfcGeom` with many schemas can exceed the 4GB image size limit of +MSVC's librarian in two situations, both tracked in issue 7461: + +- **Debug or RelWithDebInfo builds with ccache enabled.** ccache requires the + embedded `/Z7` debug information format, which bloats object files compared + to the default `/Zi` PDB format. Configure with `-DUSE_CCACHE=OFF` (added to + `run-cmake.bat` arguments) to restore the PDB format, or reduce the number + of schemas with `-DSCHEMA_VERSIONS`. +- **Release builds with `ENABLE_BUILD_OPTIMIZATIONS`.** The `/GL` whole-program + optimization flag makes the per-schema mapping objects very large. The build + now automatically compiles each schema mapping as a separate static library + on MSVC in this configuration, which avoids the limit; no action is needed on + a current checkout.