Delphi – E2003 Undeclared identifier

The compiler was unable to locate the specified identifier; it was most likely misspelt at the time of declaration or use. It could be from a different unit that doesn’t have a uses clause.

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

The variable was declared as “Counter” but was used as “Count” in the example. Either update the declaration or the places where the variable is utilised as a solution.

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

We changed the declaration in the example because it was less work.