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

Bo Berglund bo.berglund at gmail.com
Fri Feb 11 18:29:05 CET 2011


On Fri, 11 Feb 2011 08:39:18 +0200, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:

>Op 2011-02-11 00:41, Bo Berglund het geskryf:
>> 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???????
>
>As far as I know Lazarus uses CodeTools for code navigation - that is
>different to the information used by the compiler (FPC) to compile your
>project.
>
>Select "Project -> Project Options -> Show Options" and have a look an
>see if the path is indeed supplied and or correct, so FPC can find the
>unit TSerial component resides in.
>
>
Thanks, but this is my options:

-MObjFPC -Scghi -O1 -gl -WG -vewnhi -l -Filib\i386-win32
-FuC:\Engineering\Projects\Lazarus\cmp\Serial
-FuC:\Programs\lazarus_0_9_30_fixes\lcl\units\i386-win32
-FuC:\Programs\lazarus_0_9_30_fixes\lcl\units\i386-win32\win32
-FuC:\Programs\lazarus_0_9_30_fixes\packager\units\i386-win32 -Fu.
-FUlib\i386-win32\ -oproject1.exe -dLCL -dLCLwin32

Notice the second line....
That is where the Serial.pas file resides and where it is picked up by
the IDE.

Now I tried to enter the path to this dir in the project options for
"Other sources" instead, but the compile error is exactly the same.
The file is named Serial.pas and it contains amongst others this:

unit Serial;
...
interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs,Windows;

type
...
  { TSerial main class }

  TSerial = class(TComponent)
  private

etc

Do I need to add some kind of switch telling FPC that this file
originated in Delphi? I seem to recall that there is such a marker,
but I don't know what it looks like.


Bo Berglund





More information about the Lazarus mailing list