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 in the code, or, more unusually, due to errors in the compiler itself. A compilation error message often helps programmers debugging the source code for possible errors.

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

An internal compiler error (commonly abbreviated as ICE) is an error that occurs not due to erroneous source code but rather due to a bug in the compiler itself. They can sometimes be worked around by making small, insignificant changes to the source code around the line indicated by the error (if such an line is indicated at all), but sometimes larger changes must be made such as refactoring the code to avoid certain constructs or using a different compiler or different version of the compiler.

Example of an internal compiler error:

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

This article is issued from Wikipedia - version of the 6/27/2012. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.