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

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

You May Also Like

Delphi Compiler Error X2421 Imported identifier ‘%s’ conflicts with ‘%s’ in ‘%s’ Reason for the Error & Solution This occurs...
Delphi Compiler Error X2367 Case of property accessor method %s.%s should be %s.%s Reason for the Error & Solution No...
Delphi Compiler Error X2269 Overriding virtual method ‘%s.%s’ has lower visibility (%s) than base class ‘%s’ (%s) Reason for the...