Compilation error
Encyclopedia
Compilation error refers to a state when a compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

 fails to compile a piece of computer program
Computer program
A computer program is a sequence of instructions written to perform a specified task with a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute...

 source code
Source code
In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...

, either due to errors from the compiler itself, or syntax errors in the code. A compilation error message often helps programmers debugging
Debugging
Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected. Debugging tends to be harder when various subsystems are tightly coupled, as changes in one may cause bugs to emerge...

 the source code for possible syntax error
Syntax error
In computer science, a syntax error refers to an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language....

s.

Common C++ compilation errors

  • Undeclared identifier, e.g.:

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


This means that the variable "DayOfYear" is trying to be used before being declared.
  • Common function undeclared, e.g.:

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

This means that the programmer most likely forgot to include iostream.h.
  • Parse error, e.g.:

somefile.cpp:24: parse error before `something'

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.
  • internal compiler error:

somefile.c:1001: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK