Installation
Download the Windows x64 archive and extract it to any directory. CrucibleCpp is a statically linked single-file program, so no runtime needs to be installed.
Quick start
First check that PATH contains the target g++.exe. Then simply replace your existing g++ -E:
If the target GCC is not in PATH, use --gcc to specify it explicitly:
Select GCC
CrucibleCpp uses the target GCC's predefined macros, __has_* data and include search paths. Do not use a GCC 15 profile to preprocess GCC 14 headers.
| Method | Behavior |
|---|---|
--gcc-version=13|14|15 | Find the highest supported compiler in PATH that matches the major version |
--gcc <g++.exe> | Use the specified compiler directly and read its version and include paths |
| Not specified | Scan PATH and choose the highest supported version by default (15 → 14 → 13) |
--gcc, and do not rely on a fixed drive letter.Supported standard profiles:
Common command lines
| Parameters | Purpose |
|---|---|
-P | Do not output line markers |
-o <file> | Output file |
-I <dir> | Add include directory |
-isystem <dir> | System header directories |
-D / -U | Define / undefine macros |
-include <file> | Force include |
-MD -MF -MT | Generate Make/CMake dependency files |
-finput-charset / -fexec-charset | Input / execution character set |
--embed-dir <dir> | #embed search directories |
--analysis-json <file> | Output include graph, macro trace, and PCH records |
PCH
GCC's g++ -E does not use .gch; PCH is only used during real compilation. By default CrucibleCpp reads header sources, and can optionally validate, register, and cache externally generated PCHs.
Enable PCH caching:
The cache manifest records the compiler path, version, compiler hash, and options hash. PCHs from GCC 13/14/15 do not collide with each other.
Diagnostics
By default it outputs GCC-style source lines and caret. You can turn this off or adjust it:
Supports #pragma GCC diagnostic push/pop/ignored/warning/error and #pragma GCC system_header. Headers included via -isystem suppress ordinary warnings by default, and -Wsystem-headers can show them again.
Troubleshooting
Standard library headers not found
The target compiler is not in PATH. Use --gcc to specify it, or add its bin directory to PATH. You can also use -isystem to pass it explicitly.
Wrong GCC version selected
Use --gcc-version=13|14|15 to pin the major version, or use --gcc to point at a specific g++.exe. Do not mix a target profile with headers from another version.
PCH cache reports corrupt
The PCH does not match the current compiler/options, or the file is corrupt. Delete the matching cache entry and regenerate it; alternatively, turn PCH caching off entirely and let it read the header sources.
GCC cannot compile the output
First make sure preprocessing and compilation use the same GCC version and -std. Then compile the “.i” generated by CrucibleCpp separately to check whether the problem comes from the preprocessing stage.