C++ precompiled header
File type: Source code and script file
A gch file extension identifies a precompiled header used during C++ compilation, typically by the GCC compiler.
A gch file contains compiler-prepared data for a header, allowing the compiler to process that header more quickly in later builds.
File type category:
Source code and script file
Date updated: November 6, 2026
The gch file extension is associated with the GNU Compiler Collection (GCC) and GCC-based C++ development. On Microsoft Windows, Code::Blocks can use these files when configured with a compatible GCC toolchain.
For GCC, a precompiled header is commonly named after its source header with an additional .gch suffix, such as header.h.gch. Some C++ integrated development environments automate precompiled-header generation and use with ordinary .h header files.
The file is compiler-generated data rather than editable C++ source. Borland C++, C++Builder, and Visual C++ support precompiled-header workflows, but their native precompiled-header formats are not generally .gch. GCC supports the .gch format.
A gch file is intended to be read by a compatible GCC-based C++ compiler, not edited as source code. In Microsoft Windows, configure Code::Blocks to use the GCC toolchain that created the file, then build the associated project.
Visual C++, Borland C++, and C++Builder cannot normally use a GCC .gch file as their own precompiled header. A text editor may display binary or unreadable content, but it will not provide a useful way to edit the file.
A gch file is not normally converted to another format. It is generated from a C++ header by the compiler and is specific to the compiler configuration that created it.
To obtain a usable precompiled header for another compiler, rebuild it from the original header and source files with that compiler. A stale .gch file can generally be removed and regenerated during the next build.
Software applications that can open gch files:
Microsoft Windows
Software apps that create gch files:
Microsoft Windows
Software applications that handle other tasks involving gch files:
Microsoft Windows