[Lazarus] Using Packages in Lazarus

Lee Jenkins lee at datatrakpos.com
Thu Mar 27 18:17:50 CET 2008


Mattias Gärtner wrote:
> Zitat von Lee Jenkins <lee at datatrakpos.com>:
> 
>> Hi all,
>>
>> This post is a follow up to a thread in the tiOPF newsgroup.
>>
>> Background:
>> I'm using tiOPF and it uses an include file, tiDefines.inc.  The problem that
>> I
>> have (using Laz 0.9.24/FPC 2.2.0) is that Lazarus complains:
>>
>> \tiOPF2\GUI\tiGenericEditMediators.pas(23,2) Fatal: Can't open include file
>> "tiDefines.inc"
>>
>> This is a little confusing because I have actually included the directory
>> where the tiDefines.inc file is located within my project search paths.
> 
> Why *project* search paths? If the tiGenericEditMediators belongs to the tiOPF
> package, then you must extend the package search path.

What I meant was that I hadn't used the tiOPF package until that point and had 
opted to include the paths for the tiOPF units in

Project > Compiler Options > Other Unit Files

This works for the most part, except for for the tiDefines.inc file which 
lazarus seems to have trouble locating even though the folder where the 
tiDefines.inc file resides in included in Project > Compiler Options > Other 
Unit Files.



> Project search paths are *not* global search paths. They are only used in
> project directories.
> 
> 
>> If I change the source
>>
>> From:
>>    {$I tiDefines.inc}
>> To:
>>    {$I ../Core/tiDefines.inc}
>>
>> The error goes away and Laz/FPC is happy.
>>
>> I remembered Graeme suggesting to use the lazarus package file (.lpk) which
>> would solve the problem.  I did that, but it still manifests the problem.
> 
> What do you mean with 'use that'? What have you tried?

I meant that I followed Graeme's advice and included the .lpk file for tiOPF in 
my project's "Required Packages" section, but the project was still unable to 
find the tiDefines.inc file.

The only way it seems to work is if I change the directive in the source of some 
tiOPF units from {$I tiDefines.inc} to {$I ../Core/tiDefines.inc}.


Thanks,

-- 
Warm Regards,

Lee

"Everything I needed to learn in life, I learned selling encyclopedias door to 
door."



More information about the Lazarus mailing list