[Lazarus] TCodeTools not working correctly.

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Dec 7 23:43:58 CET 2008


On Sun, 7 Dec 2008 22:08:10 +0100
Raymond van Venetiƫ <rayvanve at hotmail.com> wrote:

> 
> Hello,
> 
> I've been trying to implent the CodeTools component in my
> application, but unsuccessfully.
> 
> The problem comes up when I try to "CodeTool" a unit which has
> Windows in the uses clause. Codetools will return with this error
> code: include file not found "base.inc".
> 
> We can easily reproduce this error by editing one of the codetools
> examples:
> 
> Open the "getcontext.lpr' project in the directory
> "lazarus\components\codetools\example". Now change the paths half-way
> the code correctly, mine are like these:
> Options.FPCPath:='C:\FPC\2.2.2\bin\i386-win32\fpc.exe';
> Options.FPCSrcDir:='C:\FPC\fpcbuild-2.2.2\fpcsrc';
> Options.LazarusSrcDir:='C:\lazarus';   
> 
> If you would execute the program right now, it would run fine. 
> 
> Now open "getcontextexample.pas" in the dir
> "lazarus\components\codetools\examples\scanexamples". And add the
> windows unit (might occur with different units as well, haven't found
> out yet). Your unit clause should look like: "  Windows,Classes,
> SysUtils;" now.
> 
> Now restart the program ,getcontext, and you should see there occured
> an error. 

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?
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)

 
> The output for me looks like this:
> C:\lazarus\components\codetools\examples>getcontext
> ### TCodeToolManager.HandleException: "include file not found
> "base.inc"" at Line=33 Col=5 in
> "C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\windows.pp" Contexts not
> found: include file not found "base.inc"
> 
> Now I've googled around a bit, and appreantly this error occured in
> the IDE, but got fixed. (Here is the link:
> http://www.mail-archive.com/lazarus@miraclec.com/msg06397.html).
> 
> I'm kind of stuck at the moment, so I decided to ask if someone could
> help me out.


Mattias




More information about the Lazarus mailing list