Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-03

Using Packages in Lazarus

14 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Lee Jenkins

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. 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.

Graeme suggested that I start a thread here so that he could explain it a bit better as it involves not just tiOPF's .lpk, but perhaps the general subject of using .lpk files?

Thanks,

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

Reply by email

Lee Jenkins
to Mattias Gärtner
Mattias G?rtner wrote 19 lines
Zitat von Lee Jenkins : > 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.

Show quoted text 17 lines
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."

Reply by email

Graeme Geldenhuys
to Lee Jenkins
Lee Jenkins wrote 9 lines
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}.

And the weird problem I am struggling to debug for Lee is why it works perfectly on my systems (Linux and Windows) using the exact same tiOPF.lpk package.

All Source and Include paths for tiOPF are in the tiOPF.lpk file - Lee shouldn't need to change anything relating to tiOPF in his project. At least, that's how it works for me. I'm using Lazarus v0.9.24 and v0.9.25

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Mattias Gärtner
Mattias G?rtner wrote
Maybe he copied/moved some files around?

No idea...

Show quoted text 5 lines
Where is the .lpk file, the .pas and the .inc file (full filenames)? Open the .lpk file. A package editor should appear. Open the .pas file in the source editor, right click, file settings, unit info. What include paths are listed there?

I remember months ago you and I went through this exercise to get tiOPF's packages working. Since then it has worked perfectly, on multiple systems of ours. That is why I think something is wrong in his setup (specific to his machine).

Anyway, here is the tree structure of the Source directory and the different paths show in the tiOPF.lpk package using the Unit Info dialog. The tiDefines.inc include file that he is refering to is located in the 'Core' directory. From the information below everything looks fine to me.

@Lee
How does your setup compare to mine, shown below?

/home/graemeg/programming/tiopf/Source
.
|-Compilers
|---Delphi2005
|---Delphi2006
|---Delphi2007
|---Delphi7
|---FPC
|-----lib
|-Core
|-Demos
|-GUI
|-Options
|-UnitTests

Paths shown via the Unit Info dialog....

Unit Paths
--------------
/home/graemeg/programming/tiopf/Source/Core
/home/graemeg/programming/tiopf/Source/Options
/home/graemeg/programming/tiopf/Source/3rdParty/FBLib/lib/i386-linux /opt/lazarus/packager/units/i386-linux
/home/graemeg/programming/tiopf/Source/Compilers/FPC

Include Paths
--------------------
/home/graemeg/programming/tiopf/Source/Core
/home/graemeg/programming/tiopf/Source/Compilers/FPC

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote 8 lines
/home/graemeg/programming/tiopf/Source . |-Compilers |---Delphi2005 |---Delphi2006 |---Delphi2007 |---Delphi7 |---FPC

I forgot to mention, the tiOPF.lpk package lives in the Compilers/FPC directory.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Lee Jenkins
to Graeme Geldenhuys: No idea... I remember months ago you and I went through this exercise to get tiOPF's…
Graeme Geldenhuys wrote 52 lines
On 27/03/2008, Mattias G?rtner wrote: > Maybe he copied/moved some files around? No idea... > Where is the .lpk file, the .pas and the .inc file (full filenames)? > > Open the .lpk file. A package editor should appear. > Open the .pas file in the source editor, right click, file settings, unit info. > What include paths are listed there? I remember months ago you and I went through this exercise to get tiOPF's packages working. Since then it has worked perfectly, on multiple systems of ours. That is why I think something is wrong in his setup (specific to his machine). Anyway, here is the tree structure of the Source directory and the different paths show in the tiOPF.lpk package using the Unit Info dialog. The tiDefines.inc include file that he is refering to is located in the 'Core' directory. From the information below everything looks fine to me. @Lee How does your setup compare to mine, shown below? /home/graemeg/programming/tiopf/Source . |-Compilers |---Delphi2005 |---Delphi2006 |---Delphi2007 |---Delphi7 |---FPC |-----lib |-Core |-Demos |-GUI |-Options |-UnitTests Paths shown via the Unit Info dialog.... Unit Paths -------------- /home/graemeg/programming/tiopf/Source/Core /home/graemeg/programming/tiopf/Source/Options /home/graemeg/programming/tiopf/Source/3rdParty/FBLib/lib/i386-linux /opt/lazarus/packager/units/i386-linux /home/graemeg/programming/tiopf/Source/Compilers/FPC

Hi guys,

On my XP machine I have the following:

M:\Lazarus
|-IDE
|-Projects
|-3rdPartyComponents
|---tiOPF2
|------Compilers
|----------Delph7
|----------Delphi2005
|----------Delphi2006
|----------Delphi2007
|----------FPC
|------Core
|------GUI
|------Options

On a fresh install/update of tiOPF, I just Tortoise/SVN trunk into that directly into the tiOPF2 director.

Thanks,

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

Reply by email

Mattias Gaertner
to Lee Jenkins
Show quoted text 77 lines
Graeme Geldenhuys wrote: > On 27/03/2008, Mattias G?rtner wrote: >> Maybe he copied/moved some files around? > > No idea... > >> Where is the .lpk file, the .pas and the .inc file (full >> filenames)? >> >> Open the .lpk file. A package editor should appear. >> Open the .pas file in the source editor, right click, file >> settings, unit info. What include paths are listed there? > > I remember months ago you and I went through this exercise to get > tiOPF's packages working. Since then it has worked perfectly, on > multiple systems of ours. That is why I think something is wrong in > his setup (specific to his machine). > > Anyway, here is the tree structure of the Source directory and the > different paths show in the tiOPF.lpk package using the Unit Info > dialog. The tiDefines.inc include file that he is refering to is > located in the 'Core' directory. From the information below > everything looks fine to me. > > @Lee > How does your setup compare to mine, shown below? > > > /home/graemeg/programming/tiopf/Source > . > |-Compilers > |---Delphi2005 > |---Delphi2006 > |---Delphi2007 > |---Delphi7 > |---FPC > |-----lib > |-Core > |-Demos > |-GUI > |-Options > |-UnitTests > > > Paths shown via the Unit Info dialog.... > > Unit Paths > -------------- > /home/graemeg/programming/tiopf/Source/Core > /home/graemeg/programming/tiopf/Source/Options > /home/graemeg/programming/tiopf/Source/3rdParty/FBLib/lib/i386-linux > /opt/lazarus/packager/units/i386-linux > /home/graemeg/programming/tiopf/Source/Compilers/FPC > Hi guys, On my XP machine I have the following: M:\Lazarus |-IDE |-Projects |-3rdPartyComponents |---tiOPF2 |------Compilers |----------Delph7 |----------Delphi2005 |----------Delphi2006 |----------Delphi2007 |----------FPC |------Core |------GUI |------Options On a fresh install/update of tiOPF, I just Tortoise/SVN trunk into that directly into the tiOPF2 director.

The important answers are missing:

Where is the .lpk file, the .pas and the .inc file (full filenames)?

Open the .lpk file. A package editor should appear. Open the .pas file in the source editor, right click, file settings, unit info. What include paths are listed there?

Mattias

Reply by email

Lee Jenkins
to Mattias Gaertner
Mattias Gaertner wrote 86 lines
On Thu, 27 Mar 2008 20:03:41 -0400 Lee Jenkins wrote: > Graeme Geldenhuys wrote: >> On 27/03/2008, Mattias G?rtner wrote: >>> Maybe he copied/moved some files around? >> No idea... >> >>> Where is the .lpk file, the .pas and the .inc file (full >>> filenames)? >>> >>> Open the .lpk file. A package editor should appear. >>> Open the .pas file in the source editor, right click, file >>> settings, unit info. What include paths are listed there? >> I remember months ago you and I went through this exercise to get >> tiOPF's packages working. Since then it has worked perfectly, on >> multiple systems of ours. That is why I think something is wrong in >> his setup (specific to his machine). >> >> Anyway, here is the tree structure of the Source directory and the >> different paths show in the tiOPF.lpk package using the Unit Info >> dialog. The tiDefines.inc include file that he is refering to is >> located in the 'Core' directory. From the information below >> everything looks fine to me. >> >> @Lee >> How does your setup compare to mine, shown below? >> >> >> /home/graemeg/programming/tiopf/Source >> . >> |-Compilers >> |---Delphi2005 >> |---Delphi2006 >> |---Delphi2007 >> |---Delphi7 >> |---FPC >> |-----lib >> |-Core >> |-Demos >> |-GUI >> |-Options >> |-UnitTests >> >> >> Paths shown via the Unit Info dialog.... >> >> Unit Paths >> -------------- >> /home/graemeg/programming/tiopf/Source/Core >> /home/graemeg/programming/tiopf/Source/Options >> /home/graemeg/programming/tiopf/Source/3rdParty/FBLib/lib/i386-linux >> /opt/lazarus/packager/units/i386-linux >> /home/graemeg/programming/tiopf/Source/Compilers/FPC >> > Hi guys, > > On my XP machine I have the following: > > M:\Lazarus > |-IDE > |-Projects > |-3rdPartyComponents > |---tiOPF2 > |------Compilers > |----------Delph7 > |----------Delphi2005 > |----------Delphi2006 > |----------Delphi2007 > |----------FPC > |------Core > |------GUI > |------Options > > > On a fresh install/update of tiOPF, I just Tortoise/SVN trunk into > that directly into the tiOPF2 director. The important answers are missing: Where is the .lpk file, the .pas and the .inc file (full filenames)? Open the .lpk file. A package editor should appear. Open the .pas file in the source editor, right click, file settings, unit info. What include paths are listed there?

Mattias,

The .lpk file is located in the tiOPF\Compilers\FPC directory. .pas files are in the Core and Options folders, at least the ones that are linked into my project.

Odd, right clicking on the .lpk file does in fact open lazarus but with no visible files (the editor form in lazarus is blank). The tiOPF.lpk file does have its xml in there however and I have attached it along with the tiOPF.pas file as well.

Thanks again,

Warm Regards, Lee "Everything I needed to learn in life, I learned selling encyclopedias door to door." -------------- next part -------------- A non-text attachment was scrubbed... Name: tiOPF.lpk Type: text/xml Size: 7897 bytes Desc: not available Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080327/0ca299d1/attachment.xml -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: tiOPF.pas Url: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080327/0ca299d1/attachment.pl

Reply by email

Graeme Geldenhuys
to Mattias Gaertner: On Thu, 27 Mar 2008 20:03:41 -0400 The important answers are missing: Where is the .lpk…
Mattias Gaertner wrote
Where is the .lpk file, the .pas and the .inc file (full filenames)?

/home/graemeg/programming/tiopf/Source
.
|-Compilers
|---Delphi2005
|---Delphi2006
|---Delphi2007
|---Delphi7
|---FPC
tiOPF.lpk
|-----lib
|-Core
*.pas
tiDefines.inc
|-Demos
|-GUI
|-Options
*.pas
|-UnitTests

The tiOPF.lpk package references .pas files in Core & Options. The include file, tiDefines.inc, is only in Core.

$HOME/programming/3rdParty/tiOPF2/Source/Compilers/FPC/tiOPF.lpk $HOME/programming/3rdParty/tiOPF2/Source/Core/tiDefines.inc $HOME/programming/3rdParty/tiOPF2/Source/Core/tiObject.pas $HOME/programming/3rdParty/tiOPF2/Source/Core/*.pas $HOME/programming/3rdParty/tiOPF2/Source/Options/tiQueryFBL.pas $HOME/programming/3rdParty/tiOPF2/Source/Options/*.pas

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gaertner
to Lee Jenkins: The .lpk file is located in the tiOPF\Compilers\FPC directory. .pas files are in the…
Show quoted text 16 lines
[...] Mattias Gaertner wrote: > The important answers are missing: > > Where is the .lpk file, the .pas and the .inc file (full filenames)? > > Open the .lpk file. A package editor should appear. > Open the .pas file in the source editor, right click, file settings, > unit info. What include paths are listed there? > The .lpk file is located in the tiOPF\Compilers\FPC directory. .pas files are in the Core and Options folders, at least the ones that are linked into my project. Odd, right clicking on the .lpk file does in fact open lazarus but with no visible files (the editor form in lazarus is blank).

Do you only open files via the explorer?
This will start everytime a new IDE.
It is not yet implemented to tell the already running IDE to open a further file via the explorer.
Please open files via the IDE menu items.

The tiOPF.lpk file does have its xml in there however and I have attached it along with the tiOPF.pas file as well.

Still missing:
Open your project (Project / Open project).
Then open the .pas file in the source editor (Files / Open), right click, file settings, unit info. What include paths are listed there? Compare them to the ones Graeme gave.

Mattias

Reply by email

Lee Jenkins
to Mattias Gaertner
Mattias Gaertner wrote 37 lines
On Thu, 27 Mar 2008 22:29:14 -0400 Lee Jenkins wrote: > [...] Mattias Gaertner wrote: >> The important answers are missing: >> >> Where is the .lpk file, the .pas and the .inc file (full filenames)? >> >> Open the .lpk file. A package editor should appear. >> Open the .pas file in the source editor, right click, file settings, >> unit info. What include paths are listed there? >> > The .lpk file is located in the tiOPF\Compilers\FPC directory. .pas > files are in the Core and Options folders, at least the ones that are > linked into my project. > > Odd, right clicking on the .lpk file does in fact open lazarus but > with no visible files (the editor form in lazarus is blank). Do you only open files via the explorer? This will start everytime a new IDE. It is not yet implemented to tell the already running IDE to open a further file via the explorer. Please open files via the IDE menu items. > The > tiOPF.lpk file does have its xml in there however and I have attached > it along with the tiOPF.pas file as well. Still missing: Open your project (Project / Open project). Then open the .pas file in the source editor (Files / Open), right click, file settings, unit info. What include paths are listed there? Compare them to the ones Graeme gave.

Sorry Mattias, I don't think I understood what you wanted before. This is the include paths for one of the .pas files that could not find the tiDefines.inc file:

M:\lazarus\components\tiOPF2\Core
M:\lazarus\components\tiOPF2\Options
M:\lazarus\components\tiOPF2\3rdParty\FBLib\lib\i386-win32 M:\lazarus\IDE\packager\units\i386-win32
M:\lazarus\components\tiOPF2\Compilers\FPC
M:\lazarus\projects\POSOO\commonbo
M:\lazarus\projects\POSOO\backoffice\bo
M:\lazarus\projects\POSOO\backoffice\gui
M:\lazarus\projects\POSOO\language
M:\lazarus\components\per_layer_test
M:\lazarus\components\tiOPF2\GUI
M:\lazarus\projects\POSOO\commonbo\gui
M:\lazarus\components\tiOPF2\tiOIDMediators
M:\lazarus\components\action_executor
M:\lazarus\IDE\components\popupnotifier\lib\i386-win32 M:\lazarus\IDE\components\jpeg\lib\i386-win32
M:\lazarus\IDE\ideintf\units\i386-win32
M:\lazarus\IDE\lcl\units\i386-win32
M:\lazarus\IDE\lcl\units\i386-win32\win32
M:\lazarus\projects\POSOO\backoffice

For the tiOPF.pas file itself, no paths showed under the Incuded Paths tab of UnitInfo context command.

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

Reply by email

Marco van de Voort
to Lee Jenkins: What I meant was that I hadn't used the tiOPF package until that point and had opted to…
Lee Jenkins wrote 8 lines
> > 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

That is for units. (compiler switch -Fu)

Search for includefiles uses a different path (-Fi)

This is afaik btw the same as with Delphi (-I and -U cmdline params)

Reply by email