[Lazarus] TCodeTools not working correctly.

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Dec 8 01:19:41 CET 2008


On Mon, 8 Dec 2008 00:10:22 +0100
Raymond van Venetiƫ <rayvanve at hotmail.com> wrote:

> 
> > Date: Sun, 7 Dec 2008 23:43:58 +0100
> > From: nc-gaertnma at netcologne.de
> > To: lazarus at lazarus.freepascal.org
> > Subject: Re: [Lazarus] TCodeTools not working correctly.
> > 
> > On Sun, 7 Dec 2008 22:08:10 +0100
> > Raymond van Venetiƫ <rayvanve at hotmail.com> wrote:
> > 
> > 
> > It works here under linux. 
> > (I extended the example so that you can now set the FPCTARGET
> > environment variable to see the 'cross compile' results. I set
> > FPCTARGET to win32, so I browsed the sources as if under windows).
> > 
> > Do you use the same paths in the IDE and does it work there?
> Yes, the same paths.
> > For example can you add the 'windows' unit to a
> > uses section and find the windows.pp? And then find the base.inc?
> > (find = via find declaration)
> Yep, in the IDE that works like a charm.
> 
> I've updated my Lazarus, and it looked like everything was working,
> until I removed the "{$IFDEF MSWindows}{$ENDIF}" directives from
> getcontextexample.pas. 

Ah, yes, sorry. It must be IFDEF windows.


> After that I had the same output as before
> (not exactly the same output, but the same error).
> 
> C:\lazarus\components\codetools\examples>getcontext
> TCodeToolManager.SimpleInit Config=codetools.config
> TCodeToolManager.SimpleInit PP=C:\FPC\2.2.2\bin\i386-win32\fpc.exe
> FPCDIR=C:\FPC\fpcbuild-2.2.2\fpcsrc LAZARUSDIR=C:\lazarus
> FPCTARGET=win32 ### TCodeToolManager.HandleException: "include file
> not found "base.inc"" at Lin e=33 Col=5 in
> "C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\windows.pp" Contexts not
> found: include file not found "base.inc"
> 
> So I guess that the codetoolmanager just skips the {$IFDEF MSWindows}
> part.. Here is the output with the compiler directives in
> getcontextexample.pas.
> 
> C:\lazarus\components\codetools\examples>getcontext
> TCodeToolManager.SimpleInit Config=codetools.config
> TCodeToolManager.SimpleInit PP=C:\FPC\2.2.2\bin\i386-win32\fpc.exe
> FPCDIR=C:\FPC\fpcbuild-2.2.2\fpcsrc LAZARUSDIR=C:\lazarus
> FPCTARGET=win32 Contexts found: Count=22 <Unrelated output here>

Can you try to add a line

  CodeToolBoss.SimpleInit(ConfigFilename);
  writeln('IncPath=',CodeToolBoss.GetIncludePathForDirectory('C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32'));

What is IncPath for you?

Mattias




More information about the Lazarus mailing list