title: procedure from another unit in delphi shows undeclared identifier
body: <p>I just can't seem to link a procedure from another unit to work in the main unit's form. I tried adding the procedure declaration below interface, as mentioned in this question <a href="https://stackoverflow.com/questions/1410993/how-to-run-procedure-from-another-unit">How to run procedure from another unit?</a> , but it didn't work. It keeps showing <strong>[DCC Error] Main.pas(27): E2003 Undeclared identifier: 'sayHi'</strong> Here are the codes for both units:
  Main.pas:</p>
  
  <pre><code>unit Main;
  
  interface
  
  uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Unit2;
  
  type
    TForm1 = class(TForm)
      procedure FormCreate(Sender: TObject);
    private
      { Private declarations }
    public
      { Public declarations }
    end;
  
  var
    Form1: TForm1;
  
  implementation
  
  {$R *.dfm}
  
  procedure TForm1.FormCreate(Sender: TObject);
  begin
  sayHi();
  end;
  
  end.
  </code></pre>
  
  <p>and Unit2.pas</p>
  
  <pre><code>unit Unit2;
  
  interface uses Dialogs;
  
  procedure sayHi();
  
  implementation
  
  procedure sayHi();
  begin
    ShowMessage('hi');
  end;
  
  end.
  </code></pre>
  
  <p>Here's the dpr file for the project:</p>
  
  <pre><code>program gl;
  
  uses
    Vcl.Forms,
    Main in 'Main.pas' {Form1},
    Unit2 in 'Unit2.pas';
  
  {$R *.res}
  
  begin
    Application.Initialize;
    Application.MainFormOnTaskbar := True;
    Application.CreateForm(TForm1, Form1);
    Application.Run;
  end.
  </code></pre>
  
  <p>Here is the main.dfm file:</p>
  
  <pre><code>object Form1: TForm1
    Left = 0
    Top = 0
    Caption = 'Form1'
    ClientHeight = 444
    ClientWidth = 621
    Color = clBtnFace
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    OldCreateOrder = False
    OnCreate = FormCreate
    PixelsPerInch = 96
    TextHeight = 13
  end
  </code></pre>