Delphi Error – E2003 Undeclared identifier ‘%s’

Delphi Compiler Error

E2003 Undeclared identifier ‘%s’

Reason for the Error & Solution

The compiler could not find the given identifier – most likely it has been misspelled either at the point of declaration or the point of use. It might be from another unit that has not mentioned a uses clause.

program Produce;
var
  Counter: Integer;
begin
  Count := 0;
  Inc(Count);
  Writeln(Count);
end.

In the example, the variable has been declared as “Counter”, but used as “Count”. The solution is to either change the declaration or the places where the variable is used.

program Solve;
var
  Count: Integer;
begin
  Count := 0;
  Inc(Count);
  Writeln(Count);
end.

In the example we have chosen to change the declaration – that was less work.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Delphi Compiler Error E2313 Attribute – Known attribute cannot specify properties Reason for the Error & Solution No further information...
Delphi Compiler Error E2379 Virtual methods not allowed in record types Reason for the Error & Solution No further information...
Rodrigo , one of the long time Delphi Developer has been working on one of his personal project “Delphi IDE...