[Lazarus] Identifier not found, but code completion works....
Mattias Gaertner
nc-gaertnma at netcologne.de
Fri Feb 11 15:30:48 CET 2011
On Fri, 11 Feb 2011 09:20:25 +0100
Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
> On Thu, 10 Feb 2011 23:41:27 +0100
> 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.
> >[...]
> > 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???????
>
> Do you have units with upper case letters in the file name?
> Maybe you have two units with the same name.
> Go to your uses section, where Serial is uses. Place source editor
> cursor at the end of the used unit name and use Ctrl+Space to fix the
> case.
I just got the same error.
The cause was a cross unit reference. Implementation uses sections are
evil. It's near impossible to create simple bug reports for such
compiler bugs.
Mattias
More information about the Lazarus
mailing list