Delphi Error – E2074 Label declared and referenced, but not set ‘%s’

Delphi Compiler Error

E2074 Label declared and referenced, but not set ‘%s’

Reason for the Error & Solution

You declared and used a label in your program, but the label definition was not encountered in the source code.

  program Produce;

    procedure Labeled;
    label 10;
    begin
      goto 10;
    end;

  begin
  end.

Label 10 is declared and used in the procedure ‘Labeled’, but the compiler never finds a definition of the label.

  program Produce;

    procedure Labeled;
    label 10;
    begin
      goto 10;
      10 
    end;

  begin
  end.

The simple solution is to ensure that a declared and used label has a definition, in the same scope, in your program.

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...