[Lazarus] Identifier not found, but code completion works....

Bo Berglund bo.berglund at gmail.com
Thu Feb 10 23:41:27 CET 2011


I am testing an old Delphi communications component with lazarus. I
don't want to install it as a component but instead create it in code.
So I have started a new project and added the path to the Serial unit
to the project options (Other Unit files).
I also included it in the uses clause.

In my form I have put code to create it and set its properties like
this:

procedure TForm1.FormCreate(Sender: TObject);
begin
  serComm := TSerial.Create(NIL);
end;

procedure TForm1.btnOpenClick(Sender: TObject);
begin
  serComm.Baudrate := 38400;
  serComm.DataBits := d8bit;
  serComm.StopBits := st1bit;
  serComm.FlowMode := fcNone;
  serComm.Port := 1;
  serComm.Active := true;
end;

When I did this lazarus showed me hints on what I could select when I
added the period after the serComm name, so I know that it is known by
lazarus.
But when I try to run the program lazarus shows an error:

unit1.pas(22,21) Error: Identifier not found "TSerial"

But TSerial is the class name for the component and it is found by
lazarus when I write the code, so why in heavens name does it not find
it when compiling???????


Bo Berglund





More information about the Lazarus mailing list