Sign in Join

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

Mailing lists / lazarus / 2010-09

Where to set project search paths in lazarus?

21 messages · 9 people · –

Reply by email Subscribe to this list Your subscription

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

Bo Berglund

Steep learning curve, Lazarus...

Now I have used CVS to check out a Delphi7 project I have already worked on into Ubuntu.

Started Lazarus, which created a new project.

Next I tried opening a unit file in Lazarus and then I added the file to the project in the Project Inspector.

Next I wanted to do a "syntax check" to find out the errors, but there is no such thing I can find so I used Quick Compile instead.
Lazarus claimed it could not find one of the files in my uses clause. Understandable because it is located in directory ../Common
(I always use project relative paths in my D7 projects). This directory is really:
/home/bosse/Engineering/>ProjectName>/Common

I tried to find the equivalent of Project Search path in Lazarus but found only "FPDoc files path" in the project properties so I used that to set the *absolute* path to the directories holding my units. I really wanted relative paths for portability...

But Lazarus still does not find the used units!

How are you supposed to specify where units used by the project are located if they are not in the project directory? This specification must be project specific and not global.

Bo Berglund

Reply by email

Vincent Snijders
to Bo Berglund

2010/9/29 Bo Berglund :

Show quoted text 6 lines
I tried to find the equivalent of Project Search path in Lazarus but found only "FPDoc files path" in the project properties so How are you supposed to specify where units used by the project are located if they are not in the project directory? This specification must be project specific and not global.

http://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Other_Unit_Files

Vincent

Reply by email

Bo Berglund
to Vincent Snijders
Show quoted text 11 lines
From: Vincent Snijders [mailto:] Sent: Wednesday, September 29, 2010 8:59 PM 2010/9/29 Bo Berglund : > I tried to find the equivalent of Project Search path in Lazarus > but found only "FPDoc files path" in the project properties so > How are you supposed to specify where units used by the project > are located if they are not in the project directory? > This specification must be project specific and not global.

http://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Other_Unit_F iles

I went there and added the directories as follows (on one line):
/home/bosse/Engineering/SSR8GUI/Source/;
/home/bosse/Engineering/SSR8GUI/AgiAdmin/;
/home/bosse/Engineering/SSR8GUI/Common/

Then I did a Quick Compile and got the not found error for the first unit mentioned in my test unit:
"Fatal: Can't find unit Class_AXD used by unit SSManager"

Of course I have verified that the Class_AXD.pas file is actually located in

the second of the directories listed above.

Do I have to change the extension of the pas files to pp in order for Lazarus to find the used units? Maybe pas is not a recognized ext?

Reply by email

Michael Schneider
to Bo Berglund
Bo Berglund wrote 16 lines
I went there and added the directories as follows (on one line): /home/bosse/Engineering/SSR8GUI/Source/; /home/bosse/Engineering/SSR8GUI/AgiAdmin/; /home/bosse/Engineering/SSR8GUI/Common/ Then I did a Quick Compile and got the not found error for the first unit mentioned in my test unit: "Fatal: Can't find unit Class_AXD used by unit SSManager" Of course I have verified that the Class_AXD.pas file is actually located in the second of the directories listed above. Do I have to change the extension of the pas files to pp in order for Lazarus to find the used units? Maybe pas is not a recognized ext?

Linux is case sensitive.
is the unit name the exactly same (uper lower case)?

Reply by email

José Mejuto
to Bo Berglund: http://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Other_Unit_F iles I went…

Hello Lazarus-List,

Wednesday, September 29, 2010, 9:57:50 PM, you wrote:

BB> Then I did a Quick Compile and got the not found error for the first BB> unit mentioned in my test unit:
BB> "Fatal: Can't find unit Class_AXD used by unit SSManager" BB> Of course I have verified that the Class_AXD.pas file is actually located in BB> the second of the directories listed above.

Check character cases and check that the file is not under a subdirectory.

Best regards, Jos?

Reply by email

Juha Manninen gmail
to Bo Berglund: http://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Other_Unit_F iles I went…

You should use the Delphi converter included in Lazarus: It fixes automatically all unit names to match the actual case-sensitive file name, plus does many other things.

See:
http://wiki.lazarus.freepascal.org/Delphi_Converter_in_Lazarus

What version of Lazarus are you using? If you don't have the latest SVN trunk version, please get it as soon as possible. The released version is very old and the development version is a huge improvement over it.

Juha

Reply by email

Bo Berglund
to Juha Manninen gmail
Show quoted text 13 lines
You should use the Delphi converter included in Lazarus: It fixes automatically all unit names to match the actual case-sensitive file name, plus does many other things. See: http://wiki.lazarus.freepascal.org/Delphi_Converter_in_Lazarus What version of Lazarus are you using? If you don't have the latest SVN trunk version, please get it as soon as possible. The released version is very old and the development version is a huge improvement over it.

I installed Ubuntu 10.04-2 on Sunday and then I used the Synaptic Package Manager to get Lazarus and the associated FPC compiler.
Lazarus version: 0.9.28.2-8ubuntu1
FPC version: 2.4.0

But just now I have decided to put Lazarus also on my main PC, which si Win XP-Pro SP3 so I went to the Lazarus download and retrieved lazarus-0.9.28.2-fpc-2.2.4-win32.exe, which is running the setup in the background just now.
Looks like Lazarus is the same version by the FPC is older...

I have no idea whatever of what to do in order to "get the SVN trunk", could you explain this or direct me to some HowTo on the web?

I have never used SubVersion, I work in two companies that are exclusively CVS houses....

Bo B

Reply by email

Bo Berglund
to José Mejuto: BB> Then I did a Quick Compile and got the not found error for the first BB> unit…
Check character cases and check that the file is not under a subdirectory.

That was the cause! The files are named Class_xxx.pas but in the uses clause they were listed as class_xxx!
I set the case in the uses list the same as the file name and then it worked!

But only partly because now the compiler stops with a very strange complaint!
It says that I have duplicate identifiers, when in fact I have not!

Here is an example from a class definition section:

  property Xmin: double read GetXmin;
  function Scale(Xmin, Xmax, Ymin, Ymax: Double; bSame: boolean): boolean;

I get an error because of a duplicate identifier on the function line because the property is named the same as the argument to the function! This makes no sense at all to me. Why would this be an error??? This unit compiles fine in Delphi7.

What is going on?

Bo B

Reply by email

Juha Manninen gmail
to Bo Berglund: I installed Ubuntu 10.04-2 on Sunday and then I used the Synaptic Package Manager to get…
Bo Berglund wrote 5 lines
I installed Ubuntu 10.04-2 on Sunday and then I used the Synaptic Package Manager to get Lazarus and the associated FPC compiler. Lazarus version: 0.9.28.2-8ubuntu1 FPC version: 2.4.0
You already have FPC 2.4.0 so it is easy. Just make sure you also have
Subversion installed, and then:
 $ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
 $ cd lazarus
 $ make all
 $ ./lazarus &
Show quoted text 5 lines
But just now I have decided to put Lazarus also on my main PC, which si Win XP-Pro SP3 so I went to the Lazarus download and retrieved lazarus-0.9.28.2-fpc-2.2.4-win32.exe, which is running the setup in the background just now. Looks like Lazarus is the same version by the FPC is older...

Install FPC 2.4.x + its sources from SourceForge and then get Lazarus again from SVN, either using cmd line or TortoiseSVN.

I have no idea whatever of what to do in order to "get the SVN trunk", could you explain this or direct me to some HowTo on the web?

Here:
http://wiki.lazarus.freepascal.org/Getting_Lazarus http://wiki.lazarus.freepascal.org/Installing_Lazarus

although the pages are not very good because they give an impression Lazarus installation is a big and difficult operation while it is not.

FPC trunk version installation is little more complicated but you don't need to do that.

I have never used SubVersion, I work in two companies that are exclusively CVS houses....

If you can use CVS, you can use anything. :-)

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100930/b73c66cc/attachment.html>

Reply by email

Graeme Geldenhuys
to Bo Berglund: That was the cause! The files are named Class_xxx.pas but in the uses clause they were…
Bo Berglund wrote 10 lines
property Xmin: double read GetXmin; function Scale(Xmin, Xmax, Ymin, Ymax: Double; bSame: boolean): boolean; I get an error because of a duplicate identifier on the function line because the property is named the same as the argument to the function! This makes no sense at all to me. Why would this be an error??? This unit compiles fine in Delphi7. What is going on?

You are using compiler mode {$mode objfpc} instead of {$mode delphi}. The first one (normally the default for FPC projects is more strict with object pascal syntax. The latter one is more geared to Delphi behaviour. Just to get your project to compile with minimal fuss, change to delphi compiler mode. In the long run, I would recommend you fix your code and use objfpc mode.

NOTE:
Compiler modes are set per unit. The default (if the unit doesn't contain {$mode ...} line can be set via a compiler parameter. Read the FPC compiler help for more details.

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

Reply by email

Bo Berglund
to Juha Manninen gmail: You already have FPC 2.4.0 so it is easy. Just make sure you also have Subversion…

2010/9/29 Juha Manninen (gmail) :

Show quoted text 46 lines
On Thursday 30 September 2010 00:07:03 Bo Berglund wrote: > I installed Ubuntu 10.04-2 on Sunday and then I used the > Synaptic Package Manager to get Lazarus and the associated > FPC compiler. > Lazarus version: 0.9.28.2-8ubuntu1 > FPC version: 2.4.0 You already have FPC 2.4.0 so it is easy. Just make sure you also have Subversion installed, and then: $ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus $ cd lazarus $ make all $ ./lazarus & > But just now I have decided to put Lazarus also on my main > PC, which is Win XP-Pro SP3 so I went to the Lazarus download > and retrieved lazarus-0.9.28.2-fpc-2.2.4-win32.exe, which is > running the setup in the background just now. > Looks like Lazarus is the same version by the FPC is older... Install FPC 2.4.x + its sources from SourceForge and then get Lazarus again from SVN, either using cmd line or TortoiseSVN. > I have no idea whatever of what to do in order to "get the > SVN trunk", could you explain this or direct me to some > HowTo on the web? Here: http://wiki.lazarus.freepascal.org/Getting_Lazarus http://wiki.lazarus.freepascal.org/Installing_Lazarus although the pages are not very good because they give an impression Lazarus installation is a big and difficult operation while it is not. FPC trunk version installation is little more complicated but you don't need to do that. > I have never used SubVersion, I work in two companies that > are exclusively CVS houses.... If you can use CVS, you can use anything. :-)

I tried the instructions on how to use TortoiseSVN to get the Lazarus files as described here:
http://wiki.lazarus.freepascal.org/TortoiseSvn

But Tortoise just initializes and transfers about 6 kb of data and then nothing more happens. After some time of nothing happening I try to Cancel, but that does not work so I have to close the dialog completely using the X button.
Then in order to try again I have to delete the Lazarus folder with its hidden .svn subfolder and create a new one because Tortoise does not allow checkout any longer.
Tried it three times now, always the same end: nothing is retrieved.

Is the TortoiseSVN description on the webpage erroneous?

I had to install Tortiose because all other downloads I could find were for installing an SVN *server*, which I don't want to do. So the only client I found was TortoiseSVN...

Bo B

Reply by email

Bo Berglund
to Graeme Geldenhuys: You are using compiler mode {$mode objfpc} instead of {$mode delphi}. The first one…
Graeme Geldenhuys wrote 19 lines
On 29/09/2010, Bo Berglund wrote: > > ? property Xmin: double read GetXmin; > ? function Scale(Xmin, Xmax, Ymin, Ymax: Double; bSame: boolean): boolean; > > I get an error because of a duplicate identifier on the function > line because the property is named the same as the argument to > the function! This makes no sense at all to me. Why would this > be an error??? This unit compiles fine in Delphi7. > > What is going on? You are using compiler mode {$mode objfpc} instead of {$mode delphi}. The first one (normally the default for FPC projects is more strict with object pascal syntax. The latter one is more geared to Delphi behaviour. ?Just to get your project to compile with minimal fuss, change to delphi compiler mode. In the long run, I would recommend you fix your code and use objfpc mode.

All right, when was it forbidden to have a method that has parameter Xmax and another method that also has the parameter name Xmax? Because this is precisely what FPC complains about. It also marks other parameter names like GetXmax probably because they *contain* the string Xmax in their otherwise longer names... I simply do not understand why this would be illegal...

But using the Lazarus function to convert the unit from Delphi made it stop complaining... And this while leaving my parameter names as is. Still I don't see the reason for it to begin with.

Show quoted text 5 lines
NOTE: Compiler modes are set per unit. The default (if the unit doesn't contain {$mode ...} line can be set via a compiler parameter. Read the FPC compiler help for more details.

Still think that it should not be needed for simple units, maybe for forms and more complex stuff...

Bo B

Reply by email

Graeme Geldenhuys
to Bo Berglund
Bo Berglund wrote
All right, when was it forbidden to have a method that has parameter Xmax and another method that also has the parameter name Xmax? Because this is precisely what FPC complains about.
based on your example code you wrote
> property Xmin: double read GetXmin; > function Scale(Xmin, Xmax, Ymin, Ymax: Double; bSame: boolean): boolean;

The function Scale() has a parameter named XMin, but that same class also has a property called Xmin. This can lead to lots of confusion for the developer - which XMin are we now referring too inside the Scale() method, the parameter, or the property of the class?

This is why fpc's compiler mode 'objfpc' has more strict syntax rules
- it reduces such confusion by simply not allowing them. It's quite logical I think.

But using the Lazarus function to convert the unit from Delphi made it stop complaining... And this while leaving my parameter names as is.

It because the Lazarus "convert from delphi" function automatically adds {$mode delphi} in each unit, as part of the conversion. It's more "delphi compatible" [actually just reduces the amount of issues the developer will have after a conversion], and syntax is less strict.

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

Reply by email

Juha Manninen gmail
to Bo Berglund: 2010/9/29 Juha Manninen (gmail) : I tried the instructions on how to use TortoiseSVN to…
Bo Berglund wrote 8 lines
But Tortoise just initializes and transfers about 6 kb of data and then nothing more happens. After some time of nothing happening I try to Cancel, but that does not work so I have to close the dialog completely using the X button. Then in order to try again I have to delete the Lazarus folder with its hidden .svn subfolder and create a new one because Tortoise does not allow checkout any longer. Tried it three times now, always the same end: nothing is retrieved.

Don't delete the folder but update it using TortoiseSVN. Then it will download the rest. I remember having the same issue myself. I am not developing with Windows so I can't give any better advice.

I had to install Tortiose because all other downloads I could find were for installing an SVN *server*, which I don't want to do. So the only client I found was TortoiseSVN...

Yes, with Linux everything is easier. :-)
I understood you got the Lazarus trunk version working on Linux.

Juha

Reply by email

ABorka
to Juha Manninen gmail
Juha Manninen wrote 23 lines
On Thursday 30 September 2010 13:38:25 Bo Berglund wrote: > But Tortoise just initializes and transfers about 6 kb of data and then > nothing more happens. After some time of nothing happening I try to > Cancel, but that does not work so I have to close the dialog completely > using the X button. > Then in order to try again I have to delete the Lazarus folder with its > hidden .svn subfolder and create a new one because Tortoise does > not allow checkout any longer. > Tried it three times now, always the same end: nothing is retrieved. Don't delete the folder but update it using TortoiseSVN. Then it will download the rest. I remember having the same issue myself. I am not developing with Windows so I can't give any better advice. > I had to install Tortiose because all other downloads I could find were > for installing an SVN *server*, which I don't want to do. So the only > client I found was TortoiseSVN... Yes, with Linux everything is easier. :-) I understood you got the Lazarus trunk version working on Linux. Juha

I'm using TortoiseSVN on Windows (both WinXP 32 and Win7 64) and it works perfectly for both FPC and Lazarus.
Yes, on the older XP machine it takes a while and sometimes slows the computer down significantly - sometimes even as if the computer just stopped -, but it works.

I use "http://svn.freepascal.org/svn/fpc/trunk" as the url for FPC, and
"http://svn.freepascal.org/svn/lazarus/trunk" for the Lazarus checkout/update. Then run a .bat file to run the compilation and update of FPC and Lazarus while having a drink.

I would not say that with Linux everything is easier - that is far not the case - , because both OS-es work and once you did it right, you will find it easy the following times on either platform... On Linux I use manual commands because I am too lazy to even create a script for them :)

AB

Reply by email

BosseB
to ABorka
ABorka wrote 19 lines
I'm using TortoiseSVN on Windows (both WinXP 32 and Win7 64) and it works perfectly for both FPC and Lazarus. Yes, on the older XP machine it takes a while and sometimes slows the computer down significantly - sometimes even as if the computer just stopped -, but it works. I use "http://svn.freepascal.org/svn/fpc/trunk" as the url for FPC, and "http://svn.freepascal.org/svn/lazarus/trunk" for the Lazarus checkout/update. Then run a .bat file to run the compilation and update of FPC and Lazarus while having a drink. I would not say that with Linux everything is easier - that is far not the case - , because both OS-es work and once you did it right, you will find it easy the following times on either platform... On Linux I use manual commands because I am too lazy to even create a script for them :)

I am back home now and then I used the command line command from the webpage:
svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus

This worked fine to check out a lot of files...
Maybe the command line works better than Tortoise? Or maybe the network environment at work is better? Or maybe my work Win7x64 PC is not suited whereas my home XP-Pro is?

I had installed TortoiseSVN back in 2006 (version 1.3 something) and I guess it also installed the command line client.
Now after getting Lazarus checked out I will install the latest TortoiseSVN and then try the command above for FPC.

Question:
With TortoiseSVN one gets to enter *only* the url part of the co command shown above, but the lazarus ending part is not entered, how come and how can TortoiseSVN know what module to check out?

Bo Berglund Developer in Sweden

Reply by email

Juha Manninen gmail
to BosseB
BosseB wrote
Question: With TortoiseSVN one gets to enter *only* the url part of the co command shown above, but the lazarus ending part is not entered, how come and how can TortoiseSVN know what module to check out?

The "lazarus ending part" is a local directory name. You select it from Windows file manager when working with TortoiseSVN.

Juha

Reply by email

BosseB
to BosseB: On Thu, 30 Sep 2010 12:48:11 -0700, ABorka I am back home now and then I used the command…
BosseB wrote
Now after getting Lazarus checked out I will install the latest TortoiseSVN and then try the command above for FPC.

Well, that was a disappointment! Before installing the latest TortoiseSVN I had the installation from 2006 of version 1.3.1 and it worked fine so far as concerns the Explorer context menu integration. I had Checkout SVN as a menu item.

But now after installing the latest and greatest TortoiseSVN version using the TortoiseSVN-1.6.10.19898-win32-svn-1.6.12.msi file I downloaded today I have absolutely nothing!

No right-click SVN command at all and no icon overlays on the lazarus file set I checked out with the command line client before....

What could have happened?

I have located the configuration program via the start menu, but it shows that I am using the default settings, which should show both SVN commands and overlays...

Bo Berglund Developer in Sweden

Reply by email

BosseB
to BosseB
BosseB wrote 12 lines
On Thu, 30 Sep 2010 22:18:44 +0200, BosseB wrote: >Now after getting Lazarus checked out I will install the latest >TortoiseSVN and then try the command above for FPC. But now after installing the latest and greatest TortoiseSVN version using the TortoiseSVN-1.6.10.19898-win32-svn-1.6.12.msi file I downloaded today I have absolutely nothing! What could have happened?

Apparently this is a problem that has surfaced earlier, there are mention of this already 6 months ago...
Solution: Run the installer once more, let it do a repair install and then reboot your Windows machine (ouch!).

Anyway, now I have the TSVN menus.

Bo Berglund Developer in Sweden

Reply by email

Lukasz Sokol
to BosseB
BosseB wrote 20 lines
On Thu, 30 Sep 2010 23:30:12 +0200, BosseB wrote: > On Thu, 30 Sep 2010 22:18:44 +0200, BosseB > wrote: > >> Now after getting Lazarus checked out I will install the latest >> TortoiseSVN and then try the command above for FPC. > > But now after installing the latest and greatest TortoiseSVN version > using the TortoiseSVN-1.6.10.19898-win32-svn-1.6.12.msi file I > downloaded today I have absolutely nothing! > > What could have happened? > Apparently this is a problem that has surfaced earlier, there are mention of this already 6 months ago... Solution: Run the installer once more, let it do a repair install and then reboot your Windows machine (ouch!).

Or, invoke Task Manager (Ctrl+Alt+Del), kill Explorer and re-start it.

Anyway, now I have the TSVN menus.

Lukasz

Reply by email