Compilation error

Compilation error refers to a state when a compiler fails to compile a piece of computer program source code, either due to errors from the compiler itself, or syntax errors in the code. A compilation error message often helps programmers debugging the source code for possible syntax errors.

Contents

Examples

Common C++ compilation errors

doy.cpp: In function `int main()': doy.cpp:25: `DayOfYear' undeclared (first use this function)[1]

This means that the variable "DayOfYear" is trying to be used before being declared.

xyz.cpp: In function `int main()': xyz.cpp:6: `cout' undeclared (first use this function)[1]

This means that the programmer most likely forgot to include iostream.

somefile.cpp:24: parse error before `something'[2]

This could mean that a semi-colon is missing at the end of the previous statement.

Internal Compiler Errors

These errors are not the same as normal compiler errors - they're caused by compiler itself and not the source code you're trying to compile. Which means, it's a bug in the compiler itself instead of the source code.

somefile.c:1001: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.gentoo.org/> for instructions.

References