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

Thomas Gatliff tgatliff at gatliff.com
Thu Feb 10 23:54:54 CET 2011


First, one thing I can say about the fpc is that it is a pretty solid piece
of code.  Yes, it does have some different quirks with delphi (overloading
for example), but in over 1,000,000 lines of code I have personally compiled
I have not (recently) found even one instance where it was a bug related to
the fpc.  Meaning, I always start off by questioning what I did wrong first
before blaming the compiler.  That is just me, though...  Now on to your
question...

It sounds like it fpc parser does not like your class file name for some
reason.  This is just a guess, however without looking at an strace output.
  Try several things... First, remove the file and see if it complains.  If
that does not work, baby step it by creating a new file with a different
class name...  If you still cannot figure it out, then send the files to
tgatliff at gatliff.com and I will see what happened.

On Thu, Feb 10, 2011 at 5:41 PM, Bo Berglund <bo.berglund at gmail.com> wrote:

> 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
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110210/3c42e23f/attachment-0003.html>


More information about the Lazarus mailing list