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

In your delphi application, you declared and used a label, yet there was no label definition in the source code.

  program Produce;

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

  begin
  end.

In the procedure ‘Labeled,’ the label 10 is declared and utilised, but the compiler never finds a definition for it.

  program Produce;

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

  begin
  end.

The basic approach is to make sure that every declared and used label in your application has a definition in the same scope.