为了练习类的构造和封装,自己写了这样一个小程序,设计三个单元unit Person,unit ET,unit Form,可是在写完Person单元的程序再在ET单元引用Person单元时出现了这样一个错误:找不到Person的DCU文件,于是自己尝试编译了Person单元的文件,又出现了这样一个错误:[Error] Person.pas(17): Unsatisfied forward or external declaration: 'TPerson.Create'。不知道该怎么改,麻烦大家看看,现在贴出Person单元的程序:
unit Person;interface
  uses classes,dialogs;
type
  TPerson =class
  private
    blood:char;
  protected
    DNA:string;
  public
    maName:string;
    high:integer;
  procedure setNNA(a: string);
  function getBlood:string;
  function getDNA:string;
  constructor Create;
end;
implementation
  procedure TPerson.setNNA(a:string);
   begin
     DNA:=a;
   end;
  function TPerson.getDNA:string;
    begin
      result:=DNA;
    end;
  function TPerson.getBlood:string;
    begin
      result:=blood;
    end;
var
    Color1:TPerson;
begin
  Color1:=TPerson.Create;
  Color1.DNA:='Color1 的 DNA =AA913';
  Color1.blood:='A';
  ShowMessage('Color1.DNA ='+Color1.DNA+#13
              +'Color1.blood ='+Color1.blood);
  Color1.Free;
end.