Instalation from RPM lazarus / 1-Linux ---------------------------------------------------------------------- Wanagen · 2007-03-30 23:08 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 · 2007-03-31 02:12 Yes, go with gambas ---------------------------------------------------------------------- Wanagen · 2007-03-31 05:35 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 · 2007-03-31 05:58 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 · 2007-03-31 07:34 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 · 2007-03-31 09:12 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 · 2007-03-31 09:57 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 · 2007-03-31 11:00 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. QuoteCode: [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 · 2007-03-31 11:32 i delete /usr/lib/fpc , /usr/share/fpc-src /usr/bin/ppc386 point to ../lib/fpc/2.0.4/ppc386 then inherited Destroy... TMainIDE [TMainIDE.Destroy] END [root@localhost ~]# ---------------------------------------------------------------------- theo · 2007-03-31 11:50 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 · 2007-03-31 23:32 Well thanks to the FAQ http://www.lazarus.freepascal.org/modules.php?o p=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 · 2007-04-01 05:57 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 · 2007-04-01 06:03 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 · 2007-04-01 08:31 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 · 2007-04-01 08:51 Quote from: "Wanagen"Please accept my excuses. Naturally =) QuoteBut, 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. QuoteAnd 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. ---------------------------------------------------------------------- Wanagen · 2007-04-02 04:22 Yes i'm using a different version of FPC and lazarus want to recompile itself with this version. So, why don't it do it ? Don't it remember where it's OWN sources files are ? Why MUST i add the path to Lazarus sources files ? It's Lazarus that is launching it's own recompilation. I'm not compiling lazarus from another program. ---------------------------------------------------------------------- Vincent Snijders · 2007-04-02 08:23 If you want to use a different compiler version than the one for which the Lazarus RPM has been made, you need to recompile the LCL for it. See FAQ about not finding the interfaces unit (How appropiate!). We rather have that people use the recommended compiler, so that is why it doesn't automatically recompile. If you want to do it out of the ordinary, you need to do something extra, which is documented.