internal compiler error C/C++ Origin: Application & API OSI layer 7 · Application Last updated 2 Dec 2026

g++: internal compiler error: Segmentation fault / in function, at file.c:123 — please submit a full bug report

The compiler itself crashed while compiling your code.

Exact message you may see internal compiler errorinternal compiler error: Segmentation faultplease submit a full bug report
Seen on: C/C++ GCC Clang

Meaning

An ICE is a compiler bug, not (usually) a mistake in your code, although unusual template or constexpr code often triggers it. Memory exhaustion can look like an ICE too.

Common causes

  • Bug in this compiler version (often with heavy templates, constexpr, concepts)
  • Out of memory during compilation
  • Corrupted or incompatible precompiled headers
  • Faulty RAM or overheating (random ICEs)

⚡ Quick fix

  1. Update the compiler to a newer patch release
  2. Reduce the failing file and try another compiler (clang vs gcc)
  3. Lower optimisation (-O1) or disable LTO to work around it
  4. Clear precompiled headers and rebuild

Detailed fix by platform

GCC

  1. g++ -v for the version, g++ -save-temps to keep the preprocessed .ii file for a bug report

How to diagnose

  1. Version — Latest patch?
  2. Memory — Killed by OOM?
  3. Repeatable — Same place each time?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

'this' was not captured — C++: error: 'this' was not captured for this lambda function (C/C++)'this' was not captur…cannot be implicitly captured — Clang: error: variable 'x' cannot be implicitly captured in a lambda with no capture-default specified (C/C++)cannot be implicitly …cannot bind non-const lvalue reference — C++: error: cannot bind non-const lvalue reference of type 'T&' to an rvalue of type 'T' (C/C++)cannot bind non-const…case label does not reduce to an integer constant — C/C++: error: case label does not reduce to an integer constant (C/C++)case label does not r…CMake Error: CMAKE_C_COMPILER not set / No CMAKE_CXX_COMPILER could be found — CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles" (macOS)CMake Error: CMAKE_C_…conflicting types — C: error: conflicting types for 'foo' (C/C++)conflicting typescrosses initialization — C++: error: jump to case label crosses initialization of 'int x' (C/C++)crosses initializationdoes not name a type — C++: error: 'string' does not name a type (C/C++)does not name a typeinternal …

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.