Recent

Author Topic: Instalation from RPM  (Read 14856 times)

Wanagen

  • New Member
  • *
  • Posts: 30
Instalation from RPM
« on: March 31, 2007, 01:08:19 am »
I'm tired to rewrite fpc.cfg when i install lazarus from rpm

Is there any bash to do it ?

Can someone do some program in lazarus to auto-find and auto-configure fpc.cfg .

Or may i forget my 10 years of pascal programing and go with gambas ...

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1947
RE: Instalation from RPM
« Reply #1 on: March 31, 2007, 04:12:23 am »
Yes, go with gambas

Wanagen

  • New Member
  • *
  • Posts: 30
RE: Instalation from RPM
« Reply #2 on: March 31, 2007, 07:35:22 am »
Why is it so easy to install and use lazarus with window$ and so difficult with linux ?

Is it to promote micro$oft products ?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
RE: Instalation from RPM
« Reply #3 on: March 31, 2007, 07:58:24 am »
I already installed Lazarus several times, on several different linux machines, and never had to edit my fpc.cfg.

Why do you need to edit your fpc.cfg file?

PS: Posting questions in a agressive maner will not help other people help you with your problem. Please be more polity from now on.

Wanagen

  • New Member
  • *
  • Posts: 30
RE: Instalation from RPM
« Reply #4 on: March 31, 2007, 09:34:58 am »
I have to add for example these line

-Fu/usr/lib/lazarus/lcl
-Fu/usr/lib/lazarus/lcl/widgetset
-Fu/usr/lib/lazarus/lcl/interfaces/gtk

this is only 3 of the 20+ lines i must add to compile a program.

I'm on Mandriva 2007.0 i use before this mandrake9, mandrake9.2, mandrake10.1 and mandriva 2006
and everytime i install lazarus on each of these ditrib i had to rewrite the fpc.cfg
begining with a simple program with just one button and watching errors messages like :
"/usr/lib/lazarus/lcl/dialogs.pp(204,13) Fatal: Can't find unit Dialogs"

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
RE: Instalation from RPM
« Reply #5 on: March 31, 2007, 11:12:46 am »
Well, that´s a wrong way of doing things, and can even cause trouble. The correct way is to add this information to the project information.

First remove everything you added to fpc.cfg, and make sure it´s as it was when you first installed lazarus

Next open your project on Lazarus. Now go to the menu: Project --> Compiler Options

Now notice the various edit boxes. They are the places to add aditional files.

Click on the button with 3 dots (...) next to "Other Unit Files". Select the first 2 Path templates. Click Add to add them, if they aren´t already there. Click OK. This is enougth for the compiler to find the compiled LCL units.

Now do the same for "Other Sources". Also select the first 2 templates. Click Add and OK. This field is for the IDE to find the files when you search for where identifiers are declared.

This is cross-platform, needs to be done only once for each project (notice that if you start a application project on lazarus, it will automatically do this steps for you), and takes only a few seconds to be completed.

Wanagen

  • New Member
  • *
  • Posts: 30
RE: Instalation from RPM
« Reply #6 on: March 31, 2007, 11:57:21 am »
I know how to do that.
It's not the first time i use lazarus.

I just don't want to do it each time i want to make a 3 lines' program.

I just want lazarus to recognize it's own sources without asking me where to find them.

the target os,interface and widget are defined , the base directory of lazarus and fpc are known and lazarus continue asking for the correct path of it's own sources files. (not my sources files but lazarus sources files)

For example i just reinstall lazarus and erasse all my cfg files and .lazarus dirs.

I launch lazarus, place a button on the form and compile the default program.

Code: [Select]

[root@localhost ~]# lazarus
[WARNING] *******************************************************
[WARNING] **                                                   **
[WARNING] ** Multibyte character encodings (like UTF8) are not **
[WARNING] ** supported at the moment.                          **
[WARNING] ** For full keyboard event support, make sure that   **
[WARNING] ** the LANG environment var has no UTF8              **
[WARNING] **                                                   **
[WARNING] *******************************************************
TApplication.IconChanged - TODO: convert this message...no implementation in gtk or win32
NOTE: miscellaneous options file not found - using defaults
NOTE: help options config file not found - using defaults
TMainIDE.DoNewProject A
TMainIDE.DoNewEditorFile A NewFilename=
[TCustomFormEditor.CreateComponent] Class='TForm'
TMainIDE.DoNewEditorFile end unit1.pas
[TCustomFormEditor.CreateComponent] Class='TButton'
Parent is 'Form1:TForm1'
TMainIDE.OnPropHookPersistentAdded A Button1:TButton
[TEventsCodeTool.CompleteComponent]  CurComponent=Button1:TButton
TMainIDE.DoSaveProject End
TCompiler.Compile WorkingDir="/tmp/" CompilerFilename="/usr/bin/ppc386" CompilerParams=" -S2cgi -OG1 -gl -WG -vewnhi -l -Fu/usr/lib/lazarus/lcl/units/i386-linux/ -Fu/usr/lib/lazarus/lcl/units/i386-linux/gtk/ -Fu/usr/lib/lazarus/packager/units/i386-linux/ -Fu. -dLCL -dLCLgtk /tmp/project1.lpr"
[TCompiler.Compile] CmdLine="/usr/bin/ppc386  -S2cgi -OG1 -gl -WG -vewnhi -l -Fu/usr/lib/lazarus/lcl/units/i386-linux/ -Fu/usr/lib/lazarus/lcl/units/i386-linux/gtk/ -Fu/usr/lib/lazarus/packager/units/i386-linux/ -Fu. -dLCL -dLCLgtk /tmp/project1.lpr"
Free Pascal Compiler version 2.0.4-rc3 [2006/08/09] for i386
Copyright (c) 1993-2006 by Florian Klaempfl
Target OS: Linux for i386
Compiling /tmp/project1.lpr
interfaces.pp(11,33) Fatal: Can't find unit Interfaces     <------   THAT'S WHAT I MEAN
GetMsgLineFilename Filename "interfaces.pp" not found.
TProject.SomethingModified PartOfProject unit1.pas
TMainIDE.DoSaveProject End
TMainIDE.DoCloseEditorFile A PageIndex=0
TMainIDE.CloseUnitComponent /root/unit1.pas Form1:TForm1
TMainIDE.CloseUnitComponent freeing component and designer: /root/unit1.pas Form1:TForm1
TCustomFormEditor.DeleteComponent Form1:TForm1 IsJITComponent=True FreeComponent=True
TCustomFormEditor.DeleteComponent Button1:TButton IsJITComponent=False FreeComponent=True
TMainIDE.DoCloseEditorFile end
LAZARUS END - cleaning up ...
[TMainIDE.Destroy] A
[TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
[TMainIDE.Destroy] END
[root@localhost ~]#

[/code]

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: RE: Instalation from RPM
« Reply #7 on: March 31, 2007, 01:00:26 pm »
Quote from: "Wanagen"
I know how to do that.
It's not the first time i use lazarus.
\
That explains.

Quote

For example i just reinstall lazarus and erasse all my cfg files and .lazarus dirs.


But you did not complete install all fpc installations.

Quote
Code: [Select]

Free Pascal Compiler version 2.0.4-rc3 [2006/08/09] for i386

This is the fpc compiler Lazarus has been build for, but some snapshot.

Remove that. And install fpc 2.0.4 that is on sourceforge at the same location as the lazarus executable.

Wanagen

  • New Member
  • *
  • Posts: 30
RE: Re: RE: Instalation from RPM
« Reply #8 on: March 31, 2007, 01:32:00 pm »
i delete /usr/lib/fpc , /usr/share/fpc-src

/usr/bin/ppc386 point to ../lib/fpc/2.0.4/ppc386

then

</mnt/hdc1/Linux-Downloads/fpc-2.0.4-0.i586.rpm';echo RESULT=$?
Running on linux
Write permission in /etc.
Saved old config to /etc/fpc.cfg.orig
Found libgcc.a in /usr/lib/gcc/i586-mandriva-linux-gnu/4.1.1
Writing sample configuration file to /etc/fpc.cfg
RESULT=0

</mnt/hdc1/Linux-Downloads/fpc-src-2.0.4-0.i386.rpm';echo RESULT=$?
RESULT=0

and the winner is ...

[code]
[root@localhost ~]# lazarus
[WARNING] *******************************************************
[WARNING] **                                                   **
[WARNING] ** Multibyte character encodings (like UTF8) are not **
[WARNING] ** supported at the moment.                          **
[WARNING] ** For full keyboard event support, make sure that   **
[WARNING] ** the LANG environment var has no UTF8              **
[WARNING] **                                                   **
[WARNING] *******************************************************
TApplication.IconChanged - TODO: convert this message...no implementation in gtk or win32
NOTE: miscellaneous options file not found - using defaults
NOTE: help options config file not found - using defaults
TMainIDE.DoLoadLFM A /root/unit1.pas IsPartOfProject=True
SUCCESS: streaming lfm="/root/unit1.lfm"
TMainIDE.DoLoadLFM there is no LFM file for "/usr/lib/lazarus/lcl/interfaces/gtk/interfaces.pp"
TMainIDE.DoSaveAll
TMainIDE.DoSaveProject End
TCompiler.Compile WorkingDir="/root/" CompilerFilename="/usr/bin/ppc386" CompilerParams=" -S2cgi -OG1 -gl -WG -vewnhi -l -Fu/usr/lib/lazarus/lcl/units/i386-linux/ -Fu/usr/lib/lazarus/lcl/units/i386-linux/gtk/ -Fu/usr/lib/lazarus/packager/units/i386-linux/ -Fu. -oproject1 -dLCL -dLCLgtk project1.lpr"
[TCompiler.Compile] CmdLine="/usr/bin/ppc386  -S2cgi -OG1 -gl -WG -vewnhi -l -Fu/usr/lib/lazarus/lcl/units/i386-linux/ -Fu/usr/lib/lazarus/lcl/units/i386-linux/gtk/ -Fu/usr/lib/lazarus/packager/units/i386-linux/ -Fu. -oproject1 -dLCL -dLCLgtk project1.lpr"
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.0.4-rc3 [2006/08/09] for i386
Copyright (c) 1993-2006 by Florian Klaempfl
Target OS: Linux for i386
Compiling project1.lpr
interfaces.pp(11,33) Fatal: Can't find unit Interfaces
GetMsgLineFilename Filename "interfaces.pp" not found.
TMainIDE.DoCloseEditorFile A PageIndex=1
TMainIDE.DoCloseEditorFile end
TMainIDE.DoCloseEditorFile A PageIndex=0
TMainIDE.CloseUnitComponent /root/unit1.pas Form1:TForm1
TMainIDE.CloseUnitComponent freeing component and designer: /root/unit1.pas Form1:TForm1
TCustomFormEditor.DeleteComponent Form1:TForm1 IsJITComponent=True FreeComponent=True
TCustomFormEditor.DeleteComponent Button1:TButton IsJITComponent=False FreeComponent=True
TMainIDE.DoCloseEditorFile end
LAZARUS END - cleaning up ...
[TMainIDE.Destroy] A
[TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
[TMainIDE.Destroy] END
[root@localhost ~]#

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1947
RE: Re: RE: Instalation from RPM
« Reply #9 on: March 31, 2007, 01:50:49 pm »
Did you download FPC again from http://sourceforge.net/project/showfiles.php?group_id=89339 ?
It looks like you still have RC3:
Free Pascal Compiler version 2.0.4-rc3 [2006/08/09] for i386
My FPC says:
Free Pascal Compiler version 2.0.4 [2006/08/20] for i386

Wanagen

  • New Member
  • *
  • Posts: 30
Instalation from RPM
« Reply #10 on: April 01, 2007, 01:32:45 am »
Well thanks to the FAQ http://www.lazarus.freepascal.org/modules.php?op=modload&name=FAQ&file=index&myfaq=yes&id_cat=2#q19

I add to the fpc.cfg these two lines
-Fu$lazarusdir/lcl/units
-Fu$lazarusdir/lcl/units/$LCLWidgetType

But isn't it possible for lazarus to know where it's own sources files are ?
(the lazarus dir, the target os and the widgettype are already defined in it's configuration panel)

Is it really a non-smart IDE ?

Or is lazarus only reserved to a "great-high-in-the-sky-engineers" people ?

Thanks for all your suggestions about the wright version of FPC

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Instalation from RPM
« Reply #11 on: April 01, 2007, 07:57:07 am »
Quote from: "Wanagen"
But isn't it possible for lazarus to know where it's own sources files are ?


I really don´t get you. Lazarus is a general purpose IDE. You can use it to write pure fpc software that don´t use LCL, the Lazarus Component Library.

If you want to write a application that uses a Library, you must add the path to the library, and LCL is no different then other libraries.

If you find the Compiler options dialog so disturbing you can also add the LCL package as a required package on the Project Inspector

Suppose you are using another GUI library that should never be used together with LCL. And it has a unit with the same name as a unit from LCL. Which unit will be used??? Both libraries are added, althougth you really should have added only one.

PS: Cut out the agressivity, that´s your last warning.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Instalation from RPM
« Reply #12 on: April 01, 2007, 08:03:22 am »
Ok, I really think you should learn some more about why people should be polite, so I quoted some things from wikipedia and added a few links:

From Wikipedia:

Purpose of manners

Manners ease the stress of communal living, and mannerly behavior recognizes the right of others to share communal space. Many of our daily expressions of politeness reflect this function. Saying "excuse me," for example, shows that you recognize that you have invaded another's space, and regret the necessity of doing so. It is a basic tenet in law that it is wrongful to cause damages to another (see norm). Since there cannot be a law for every slight, daily causing of damage to another, manners serve to at least acknowledge, if not make recompense, for the damage.

Some links:

http://en.wikipedia.org/wiki/Manners

http://en.wikipedia.org/wiki/Politeness

http://logos.uoregon.edu/explore/socioling/politeness.html

Wanagen

  • New Member
  • *
  • Posts: 30
Instalation from RPM
« Reply #13 on: April 01, 2007, 10:31:45 am »
Your are wright.
I was too agressive .

Please accept my excuses.

You are wright too when you said that Lazarus is a general purpose IDE and that it can compile pure FPC program without LCL libraries.

But, when you start a new project Lazarus ask you if it's a graphic or text application or if it's a unit or a library.
Wouldn't it be smart to insert at this point a link to the correct path for Lazarus to find the libraries it need ?

If you want to use a other widgettype that is not recognize by Lazarus and it's libraries (gtk,gtk2,gnome,win32,wince,carbon,qt), wouldn't it be usefull to have the option to said other or custom in the configuration panel ?

If a unit of mine have the same name than one already compiled, wouldn't it be usefull that Lazarus warn me when i compile the program ?

And the last but not the least.
When someone download and install Lazarus for the first time, i guess it was at 80% to make graphics applications. Wouldn't it be interesting to simplify his life by adding some of this options ?

I renew my excuses but many forum are full of this simple question: "why can't i compile my application". The traditional answer is "go to project/compiler optopns and add the path where to find Lazarus libraries and do it every time you create a new project"

Thanks.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Instalation from RPM
« Reply #14 on: April 01, 2007, 10:51:20 am »
Quote from: "Wanagen"
Please accept my excuses.


Naturally =)

Quote
But, when you start a new project Lazarus ask you if it's a graphic or text application or if it's a unit or a library.
Wouldn't it be smart to insert at this point a link to the correct path for Lazarus to find the libraries it need ?


But it does. I just tested to be sure. File --> New --> Application

It will create a new lazarus project with LCL package as a dependency, so you don´t need to change anything else. Just save the project and run it.

I think this didn´t work on your particular case because you were using a different version for fpc. Free Pascal will refuse object files created with different versions of it, and will then want to recompile LCL with the correct compiler. When you install lazarus it already comes with precompiled LCL for fpc 2.0.4 final release. You were using release candidate 3.

Quote
And the last but not the least.
When someone download and install Lazarus for the first time, i guess it was at 80% to make graphics applications. Wouldn't it be interesting to simplify his life by adding some of this options ?


When you first run lazarus you will be gifted with a empty application project, which requires nothing more then saving and pressing F9 to be run. LCL is already added as a dependency.

 

TinyPortal © 2005-2018