Sign in Join

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

Mailing lists / lazarus / 2009-05

Project LPI Files and Platforms

14 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

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

Mehmet Erol Sanliturk

Dear Lazarus Developers ,

Project LPI files are created at present as project_name.LPR and project_name.LPI , and others .

This structure for LPI files is making difficult to develop the same project for multiple platforms in the following sense .

Assume all of the source code is in a USB stick ( or in a comon server ) with project definition files .
The initial project is developed in , for example , in Windows . When the same project is tried to be compiled in Linux , its LPI file is not compatible for the Linux Lazarus installation structure . It is necessary to modify the settings and store the project_name.LPI with the effect that project_name.LPI developed in Windows is lost .

( I know it is possible to copy with a new name and apply other suitable steps . )

The same effects will be encountered when it is brought to FreeBSD .

To prevent such mismatches , my suggestion is as follows :

For each distinct Lazarus installation environment , use a different project name format for the LPI files :

For example : project_name.BSD.LPI
project_name.Linux.LPI
project_name.XP.LPI

and possibly others .

Such a naming facility will require additional programming efforts , but for multiple platform compilations , it will allow to use common servers by developers and compile the projects from any client only by using its own client platform related LPI file without affecting other platform LPI files .

Thank you very much .

Mehmet Erol Sanliturk

Reply by email

Michael Fuchs
to Mehmet Erol Sanliturk
Show quoted text 11 lines
Project LPI files are created at present as project_name.LPR and project_name.LPI , and others . This structure for LPI files is making difficult to develop the same project for multiple platforms in the following sense . Assume all of the source code is in a USB stick ( or in a comon server ) with project definition files . The initial project is developed in , for example , in Windows . When the same project is tried to be compiled in Linux , its LPI file is not compatible for the Linux Lazarus installation structure .

Why that? I switch daily between Windows and Linux and use the same project files (via subversion). No Problems.

mfg
Michael

Reply by email

Graeme Geldenhuys
to Michael Fuchs
Michael Fuchs wrote
Why that? I switch daily between Windows and Linux and use the same project files (via subversion). No Problems.

+1
I use the same project .lpi files under Linux, FreeBSD, DesktopBSD and Windows. Lazarus IDE automatically handles directory separators etc in the .lpi file. What problems do you experience?

Regards,
- Graeme -

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

Reply by email

Bogusław Brandys
to Michael Fuchs: Why that? I switch daily between Windows and Linux and use the same project files (via…
Michael Fuchs wrote 25 lines
Mehmet Erol Sanliturk schrieb: > Project LPI files are created at present as project_name.LPR and > project_name.LPI , and others . > > This structure for LPI files is making difficult to develop the same > project for multiple platforms in the following sense . > > Assume all of the source code is in a USB stick ( or in a comon server > ) with project definition files . > The initial project is developed in , for example , in Windows . > When the same project is tried to be compiled in Linux , its LPI file > is not compatible for the Linux Lazarus installation structure . Why that? I switch daily between Windows and Linux and use the same project files (via subversion). No Problems. mfg Michael _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

AFAIK lpi is XML file and Lazarus modify lpi "on the fly" adjusting proper path delimiters.I work barely on linux but never saw any major probelm with lpi (except some buggy old revisions of lazarus svn)

Boguslaw

Reply by email

Mattias Gaertner
to Mehmet Erol Sanliturk: Project LPI files are created at present as project_name.LPR and project_name.LPI , and…
Show quoted text 15 lines
Dear Lazarus Developers , Project LPI files are created at present as project_name.LPR and project_name.LPI , and others . This structure for LPI files is making difficult to develop the same project for multiple platforms in the following sense . Assume all of the source code is in a USB stick ( or in a comon server ) with project definition files . The initial project is developed in , for example , in Windows . When the same project is tried to be compiled in Linux , its LPI file is not compatible for the Linux Lazarus installation structure .

Why? What is not compatible?

1. The lpi file stores the used path delimiter and converts the paths automatically.
2. The file names are stored as UTF-8.
3. The IDE always tries to store relative file names.
4. The IDE tries to find out the real file upper/lower under windows.
5. Machine specific information can be stored in a separate file (lps).
6. You can use macros for various platform specific path parts (e.g. TargetOS).

Just store your project in one directory with sub directories and you can copy/share it anywhere.

It is necessary to modify the settings and store the project_name.LPI with the effect that project_name.LPI developed in Windows is lost .

Please give an example.

Show quoted text 21 lines
( I know it is possible to copy with a new name and apply other suitable steps . ) The same effects will be encountered when it is brought to FreeBSD . To prevent such mismatches , my suggestion is as follows : For each distinct Lazarus installation environment , use a different project name format for the LPI files : For example : project_name.BSD.LPI project_name.Linux.LPI project_name.XP.LPI and possibly others . Such a naming facility will require additional programming efforts , but for multiple platform compilations , it will allow to use common servers by developers and compile the projects from any client only by using its own client platform related LPI file without affecting other platform LPI files .

Most projects use the same settings under all platforms - that's the big advantage of Lazarus/FPC versus many other native compilers.

Mattias

Reply by email

Mehmet Erol Sanliturk
to Mattias Gaertner
Mattias Gaertner wrote 5 lines
On Fri, 15 May 2009 08:31:27 -0400 Mehmet Erol Sanliturk wrote: Why? What is not compatible?

For example :

In FreeBSD ( 7.1 ) :
/usr/local/share/lazarus/
/usr/local/lib/fpc/2.2.2/

Windows XP : \lazarus\

Linux ( Kubuntu 9.04 ) :
/usr/lib/lazarus/

1. The lpi file stores the used path delimiter and converts the paths automatically.

Path delimiter conversion is not sufficient for the Lazarus related directory names . Platform related conversions are needed ( if a single LPI file used , or Platform specific Lazarus directory names are stored with their tags to select during LPI loading with respect to platform . )

Show quoted text 18 lines
2. The file names are stored as UTF-8. 3. The IDE always tries to store relative file names. 4. The IDE tries to find out the real file upper/lower under windows. 5. Machine specific information can be stored in a separate file (lps). 6. You can use macros for various platform specific path parts (e.g. TargetOS). Just store your project in one directory with sub directories and you can copy/share it anywhere. > It is necessary to modify the settings and store the project_name.LPI > with the effect that project_name.LPI developed in Windows is lost . Please give an example.

Assume you have three Intel ( or AMD ) processor based computers .

(1) Windows
(2) Linux

In each of the above computers , develop a similar project by including components from palettes with the similar types .

Compile these projects in their computers . All of them will be compiled

successfully ( by using their defaults ).

Copy project files to a USB stick in Windows machine (1), submit it to the third machine (3) having Linux identical to in machine (2) .

You will get an error like : Graphics is not found . depending on unit uses list order although the same program is compiled successfully in the machine (2) .

The same project with the same structure is not compilable in another platform only due to LPI differences .

The above example is also an answer to question by Graeme :

-- I use the same project .lpi files under Linux, FreeBSD, DesktopBSD and -- Windows. Lazarus IDE automatically handles directory separators etc in -- the .lpi file. What problems do you experience? -- > > > Most projects use the same settings under all platforms - that's the big > advantage of Lazarus/FPC versus many other native compilers. > > > Mattias > > My suggestion is to eliminate this incompatibility about directory names structure of installed Lazarus in different platforms for LPI files . Using Version control systems is a different case . Assume a student is using a computer at home and another at the school with different platforms carrying his/her projects with a USB stick or with a transportable hard disk . Thanks to all of the respondents very much . Mehmet Erol Sanliturk

Reply by email

Graeme Geldenhuys
to Mehmet Erol Sanliturk
Mehmet Erol Sanliturk wrote 13 lines
> > Why? What is not compatible? For example : In FreeBSD ( 7.1 ) : ? ? ? ? ? ? ? ?/usr/local/share/lazarus/ ? ? ? ? ? ? ? ?/usr/local/lib/fpc/2.2.2/ ? Windows XP : \lazarus\ ? Linux ?( Kubuntu 9.04 ) : ? ? ? ? ? ? ? ?/usr/lib/lazarus/

That's got nothing to do with project LPI files. That is settings stored in your lazarus user profile directory (nothing to do with projects). Lazarus already supports a command line parameter so you can specify a preferred profile directory if the default is not sufficient.

eg: lazarus --pcp=/home/graemeg/.lazarus-testprofile lazarus --pcp=c:\users\graemeg\lazarus-windows-test-profile

Path delimiter conversion is not sufficient for the Lazarus related directory names . Platform related conversions are needed ( if a single LPI file used , or Platform specific Lazarus directory names are stored with

I have used single .lpi files for all our cross-platform projects and it works perfectly for years. We have developers that code under Windows and Linux working on the same project the whole time.

Show quoted text 6 lines
You will get an error like : Graphics is not found . depending on unit uses list order although the same program is compiled successfully in the machine (2) . The same project with the same structure is not compilable in another platform only due to LPI differences .

We have never had such an issue. Lazarus has support for "macro" entries in path directories etc.. for example. Lazarus packages already use $(PkgOutDir)/ which creates output directies like: i386-linux or i386-win32 so compiled units don't conflict on various OS's. If we compile from the command line we define similar output directories.

Lazarus and FPC have many $(xxx) macros for paths and values. You might need to take a look at how your fpc.cfg file is setup as well. Like I said, we have used the same projects under FreeBSD, Linux (32 & 64bit) and Windows all using the same .lpi file checkout out of a SubVersion or Git repository. We have no problems. It sounds more like you have a problem with how you setup your development environment.

Assume a student is using a computer at home and another at the school with different platforms carrying his/her projects with a USB stick or with a transportable hard disk .

I have many of my projects in a Git cloned repository on a removable hard drive. I carry that between work and home. Different systems, different OS's and again no problems.

Regards,
- Graeme -

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

Reply by email

Mattias Gaertner
to Mehmet Erol Sanliturk: For example : In FreeBSD ( 7.1 ) : /usr/local/share/lazarus/ /usr/local/lib/fpc/2.2.2/…
Show quoted text 17 lines
Mattias Gaertner wrote: > On Fri, 15 May 2009 08:31:27 -0400 > Mehmet Erol Sanliturk wrote: > > > Why? What is not compatible? For example : In FreeBSD ( 7.1 ) : /usr/local/share/lazarus/ /usr/local/lib/fpc/2.2.2/ Windows XP : \lazarus\ Linux ( Kubuntu 9.04 ) : /usr/lib/lazarus/

These are the lazarus and fpc installation paths. These are set globally and there are macros for them. Although I wonder, why you need them in your project.

Show quoted text 8 lines
> 1. The lpi file stores the used path delimiter and converts the > paths automatically. Path delimiter conversion is not sufficient for the Lazarus related directory names . Platform related conversions are needed ( if a single LPI file used , or Platform specific Lazarus directory names are stored with their tags to select during LPI loading with respect to platform . )

I never needed that. Can you give more details what you want to achieve?

Show quoted text 39 lines
> 2. The file names are stored as UTF-8. > 3. The IDE always tries to store relative file names. > 4. The IDE tries to find out the real file upper/lower under > windows. > 5. Machine specific information can be stored in a separate file > (lps). 6. You can use macros for various platform specific path > parts (e.g. TargetOS). > > Just store your project in one directory with sub directories and > you can copy/share it anywhere. > > >> It is necessary to modify the settings and store the >> project_name.LPI with the effect that project_name.LPI developed >> in Windows is lost . > > Please give an example. > Assume you have three Intel ( or AMD ) processor based computers . (1) Windows (2) Linux In each of the above computers , develop a similar project by including components from palettes with the similar types . Compile these projects in their computers . All of them will be compiled successfully ( by using their defaults ). Copy project files to a USB stick in Windows machine (1), submit it to the third machine (3) having Linux identical to in machine (2) .

No problem. I do that every day.

You will get an error like : Graphics is not found . depending on unit uses list order although the same program is compiled successfully in the machine (2) .

If it compiles, but the IDE can not find a unit, then you maybe setup the search paths only in the fpc.cfg.
Have you added the LCL to project inspector dependencies?

Show quoted text 11 lines
The same project with the same structure is not compilable in another platform only due to LPI differences . The above example is also an answer to question by Graeme : -- -- I use the same project .lpi files under Linux, FreeBSD, DesktopBSD and -- Windows. Lazarus IDE automatically handles directory separators etc in -- the .lpi file. What problems do you experience? --

I still do not understand where the problem is.

Show quoted text 10 lines
[...] My suggestion is to eliminate this incompatibility about directory names structure of installed Lazarus in different platforms for LPI files . Using Version control systems is a different case . Assume a student is using a computer at home and another at the school with different platforms carrying his/her projects with a USB stick or with a transportable hard disk .

Pretty normal situation.
Of course if something can be made wrong, then there will be a student who does.

Mattias

Reply by email

Mehmet Erol Sanliturk
to Mattias Gaertner
Mattias Gaertner wrote 119 lines
On Sat, 16 May 2009 03:38:48 -0400 Mehmet Erol Sanliturk wrote: > Mattias Gaertner wrote: >> On Fri, 15 May 2009 08:31:27 -0400 >> Mehmet Erol Sanliturk wrote: >> >> >> Why? What is not compatible? > For example : > > In FreeBSD ( 7.1 ) : > /usr/local/share/lazarus/ > /usr/local/lib/fpc/2.2.2/ > > Windows XP : \lazarus\ > > Linux ( Kubuntu 9.04 ) : > /usr/lib/lazarus/ These are the lazarus and fpc installation paths. These are set globally and there are macros for them. Although I wonder, why you need them in your project. >> 1. The lpi file stores the used path delimiter and converts the >> paths automatically. > Path delimiter conversion is not sufficient for the Lazarus related > directory names . Platform related conversions are needed ( if a > single LPI file used , or Platform specific Lazarus directory names > are stored with their tags to select during LPI loading with respect > to platform . ) I never needed that. Can you give more details what you want to achieve? >> 2. The file names are stored as UTF-8. >> 3. The IDE always tries to store relative file names. >> 4. The IDE tries to find out the real file upper/lower under >> windows. >> 5. Machine specific information can be stored in a separate file >> (lps). 6. You can use macros for various platform specific path >> parts (e.g. TargetOS). >> >> Just store your project in one directory with sub directories and >> you can copy/share it anywhere. >> >> >>> It is necessary to modify the settings and store the >>> project_name.LPI with the effect that project_name.LPI developed >>> in Windows is lost . >> Please give an example. >> > > Assume you have three Intel ( or AMD ) processor based computers . > > (1) Windows > (2) Linux > > > In each of the above computers , develop a similar project by > including components from palettes with the similar types . > > Compile these projects in their computers . All of them will be > compiled > > successfully ( by using their defaults ). > > > Copy project files to a USB stick in Windows machine (1), > submit it to the third machine (3) having Linux identical to in > machine (2) . No problem. I do that every day. > You will get an error like : Graphics is not found . > depending on unit uses list order although the same program is > compiled successfully in the machine (2) . If it compiles, but the IDE can not find a unit, then you maybe setup the search paths only in the fpc.cfg. Have you added the LCL to project inspector dependencies? > The same project with the same structure is not compilable in another > platform only due to LPI differences . > > > The above example is also an answer to question by Graeme : > > -- > -- I use the same project .lpi files under Linux, FreeBSD, DesktopBSD > and -- Windows. Lazarus IDE automatically handles directory > separators etc in -- the .lpi file. What problems do you experience? > -- I still do not understand where the problem is. > [...] > My suggestion is to eliminate this incompatibility about directory > names structure of installed Lazarus in different platforms for LPI > files . > > Using Version control systems is a different case . > > Assume a student is using a computer at home and another at the > school with different platforms carrying his/her projects with a USB > stick or with a transportable hard disk . Pretty normal situation. Of course if something can be made wrong, then there will be a student who does. Mattias

I think initially my message did not specify the setup I have used which caused different views .

In a Windows machine I have a project with a single form with most of the components of Lazarus IDE palettes placed on it . Lazarus is compiling it successfully when it is installed freshly after previous installation has been removed completely .

I want to transport one of my programs from Windows to Linux .

I have installed a fresh Linux , Kubuntu 9.04 .
I have installed Lazarus .

No any other Pascal related installations or any other modifications to any other configuration files .

To see which parts should be modified or improved just depending on platform differences , I copied my All-Forms-Parts.* project files to a USB stick .

In Linux , I created a directory and copied all the files there . I have started Lazarus and started its compilation .

It gave the error : Graphics is not found .

In Lazarus , I generated the same project in a different directory with the similar components . I compiled it . It compiled successfully .

The only difference is LPI file .

I thought reporting this experience would be useful .

Thank you very much .

Mehmet Erol Sanliturk

Reply by email

Mattias Gaertner
to Mehmet Erol Sanliturk
Show quoted text 28 lines
[...] I think initially my message did not specify the setup I have used which caused different views . In a Windows machine I have a project with a single form with most of the components of Lazarus IDE palettes placed on it . Lazarus is compiling it successfully when it is installed freshly after previous installation has been removed completely . I want to transport one of my programs from Windows to Linux . I have installed a fresh Linux , Kubuntu 9.04 . I have installed Lazarus . No any other Pascal related installations or any other modifications to any other configuration files . To see which parts should be modified or improved just depending on platform differences , I copied my All-Forms-Parts.* project files to a USB stick . In Linux , I created a directory and copied all the files there . I have started Lazarus and started its compilation . It gave the error : Graphics is not found .

I thought compilation worked. Maybe this is another problem.

Show quoted text 6 lines
In Lazarus , I generated the same project in a different directory with the similar components . I compiled it . It compiled successfully . The only difference is LPI file .

What is the difference between the two lpi files?
Can you send me the two lpi files?

I thought reporting this experience would be useful .

Yes

Mattias

Reply by email

Mehmet Erol Sanliturk
to Mattias Gaertner
Mattias Gaertner wrote
On Sat, 16 May 2009 06:33:00 -0400 Mehmet Erol Sanliturk wrote: > [...]
I thought compilation worked. Maybe this is another problem.
Show quoted text 12 lines
> The only difference is LPI file . What is the difference between the two lpi files? Can you send me the two lpi files? > I thought reporting this experience would be useful . Yes Mattias

I am continuously installing operating systems and last Lazarus snapshots .

To send the above files
I searched the existent directories but all of the previous files were deleted due to renewed operating system installations .

On this event , I generated a new form with many components in CentOS 5.3 and compiled it successfully .

Into XP Home I have installed Lazarus and compiled my form with nearly all components successfully .

Version # : 0.9.26.3 beta
Date : 2009-04-26
SVN Revision : 19625
i386-win32-win32/win64

I have copied only project1.( lpi , lpr ) , unit1. ( pas , lfm , lrs ) files to a USB stick and copied to CentOS 5.3 computer . It compiled successfully .

Version # : 0.9.27 beta
Date : 2009-04-24
FPC Version : 2.2.4
SVN Revisison : 19594
x86-64-linux-gtk 2 ( beta )

I copied the above files into Kubuntu 9.04 and they compiled again successfully .

Version # : 0.9.26-4 beta
Date : 2009-01-08
FPC Version : 2.2.2
SVN Revisison : 16881
x86-64-linux-gtk

I copied the above files into FreeBSD 7.1-Stable and they compiled again successfully .

Version # : 0.9.26 beta
Date : 2009-04-05
FPC Version : 2.2.2
SVN Revisison : Unknown
i386-freebsd-gtk

Really I am very sorry about my initial message without testing latest Lazarus versions .

I have only FreeBSD files in a USB stick with a FPC.CFG file about Windows Lazarus . I think , my previous compilations failed due to that FPC.CFG file .

To understand effect of FPC.CFG file on present installation , I tested all of the above Lazarus installations with a new directory having the above files with addition of that FPC.CFG file .

I have renamed all of the previous directories to prevent loading of them by Lazarus at start up .

I compiled the program in that new directory having FPC.CFG file .

In all of the operating systems Lazarus compiled the program successfully without considering existent FPC.CFG file .

I am very pleased to see that previous errors do not occur and Lazarus with Free Pascal improved over time significantly .

Again I thank to all the respondents for their efforts to solve my problem with the understanding that all of their ideas are taken into consideration with thanks to reach a useful end .

Thank you very much .

Mehmet Erol Sanliturk

Reply by email

Mehmet Erol Sanliturk
to Mehmet Erol Sanliturk
Mehmet Erol Sanliturk wrote 81 lines
Mattias Gaertner wrote: > On Sat, 16 May 2009 06:33:00 -0400 > Mehmet Erol Sanliturk wrote: > >> [...] > > I thought compilation worked. Maybe this is another problem. > > >> The only difference is LPI file . > > What is the difference between the two lpi files? > Can you send me the two lpi files? > > >> I thought reporting this experience would be useful . > > Yes > > Mattias > I am continuously installing operating systems and last Lazarus snapshots . To send the above files I searched the existent directories but all of the previous files were deleted due to renewed operating system installations . On this event , I generated a new form with many components in CentOS 5.3 and compiled it successfully . Into XP Home I have installed Lazarus and compiled my form with nearly all components successfully . Version # : 0.9.26.3 beta Date : 2009-04-26 SVN Revision : 19625 i386-win32-win32/win64 I have copied only project1.( lpi , lpr ) , unit1. ( pas , lfm , lrs ) files to a USB stick and copied to CentOS 5.3 computer . It compiled successfully . Version # : 0.9.27 beta Date : 2009-04-24 FPC Version : 2.2.4 SVN Revisison : 19594 x86-64-linux-gtk 2 ( beta ) I copied the above files into Kubuntu 9.04 and they compiled again successfully . Version # : 0.9.26-4 beta Date : 2009-01-08 FPC Version : 2.2.2 SVN Revisison : 16881 x86-64-linux-gtk I copied the above files into FreeBSD 7.1-Stable and they compiled again successfully . Version # : 0.9.26 beta Date : 2009-04-05 FPC Version : 2.2.2 SVN Revisison : Unknown i386-freebsd-gtk Really I am very sorry about my initial message without testing latest Lazarus versions .

I could be able to generate the errors I have mentioned in my first message .

Those errors are caused by paths stored into LPI files about user program when compilation in Windows requires them or perhaps unnecessarily specified in IDE by the user .

When such an LPI file is loaded by Lazarus in another operating system it is giving an error message about a Lazarus supplied unit is not found instead of saying a path is encountered which does not exist in this platform .

The above tests are performed with an LPI file which it does not contain any Windows related path .

After sending the above message I searched my other project LPI files and found one having Windows related paths .

When this file is submitted to Lazarus in CentOS 5.3 , it generated the error I mentioned in my first message .

At this point , I want to tell about my another experience nearly one year ago.
During my compilations in Windows with FPC I noticed that when a path is incorrectly specified in an fpc.cfg file , the compiler is saying that a source is not found although the source is present . After traversing compiler sources I understood that the real error is incorrectly specified path in fpc.cfg file . I included statements about -Fu , -Fi path evaluation parts to check whether the specified path exists or not during loading of fpc.cfg . When a path does not exist , compiler issues an error .

This feature is really a life saver for such cases . I did not submit any bug report with the fear that such an idea will not be welcomed because it will be considered an unnecessary feature request . Now I think that this was a real mistake .

As a conclusion I may say that the paths themselves should be checked at points where they are given .

Thank you very much .

Mehmet Erol Sanliturk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: project1.lpi
Type: text/xml
Size: 6573 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20090517/d7388277/attachment.xml> -------------- next part --------------
A non-text attachment was scrubbed...
Name: project1-having-Win-paths.lpi
Type: text/xml
Size: 3839 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20090517/d7388277/attachment-0001.xml>

Reply by email

Reenen Laurie
to Mehmet Erol Sanliturk

Apologies for the format or brevity of the mail, as i'm reading and sending it from my broken phone...

I just want to echo Mehmet's issues. I too have experienced similar problems and my pet project still has to project files 1 for windows and 1 for linux. It just seemed that most people didnt get similar issues, and i want to show it is not isolated.

Crappy fpc is likely to blame or maybe as someone suggested not adding the lcl as a dependancy?

o__ ,_.>/ _ (_)_\(_)_______ ...speed is good _______________ I believe five out of four people have a problem with fractions.

Reply by email

Mattias Gaertner
to Mehmet Erol Sanliturk: I could be able to generate the errors I have mentioned in my first message . Those…
Show quoted text 12 lines
[...] I could be able to generate the errors I have mentioned in my first message . Those errors are caused by paths stored into LPI files about user program when compilation in Windows requires them or perhaps unnecessarily specified in IDE by the user . When such an LPI file is loaded by Lazarus in another operating system it is giving an error message about a Lazarus supplied unit is not found instead of saying a path is encountered which does not exist in this platform .

The unit search path contains absolute file names.

In this specific case:
c:\lazarus\lcl\;
c:\lazarus\lcl\units\i386-win32\;
c:\lazarus\fpc\2.2.1\units\i386-win32\fcl-base\;
c:\lazarus\fpc\2.2.1\source\packages\fcl-base\src\

The first two paths are unneeded, because the project already uses the LCL package, which adds the paths automatically.
The last two paths are pointing into the FPC source directories. This is only useful if you are working on the FPC units. Otherwise it can create conflicts, if your FPC sources and installed units do not fit exactly.

The IDE does not shorten automatically the unit search path because absolute path names are needed for machine dependent projects.

If you want platform independent search paths use
packages
or relative file names
or macros like $(LazarusDir) or $(FPCSrcDir).

See here for the complete list:
http://wiki.lazarus.freepascal.org/IDE_Macros_in_paths_and_filenames

[...] As a conclusion I may say that the paths themselves should be checked at points where they are given .

Maybe a warning should be issued when absolute file names are filled into the search paths.

Mattias

Reply by email