absolute lazarus / 1-Linux ---------------------------------------------------------------------- Kamau · 2012-12-22 06:24 Hello, I am an old Delphi-programmer and I discovered Lazarus just a few days ago. Installed it on an XP computer. It works fantastic! Yesterday tried to install i on CentOS. Installation no problem. I used yum and IDE version 0.9.26 was installed. The fpc version is 2.4.0 Had to add unit-directories. Now when compiling a "program" containing no own code, just a form, I get the error: "absolute can only be associated with a var or const" Which is quite logical BUT..... The units included in Lazarus have several absolute declarations referring to types, not variables. How do I get around this? Is there a compiler switch to use in order to ignore this error? /Kamau ---------------------------------------------------------------------- irfanbagus · 2012-12-22 09:06 wow 0.9.26 why you don't try newest version (1.0.4) ? if package for your distro not available, it's easy and fast to build lazarus from source as long as you aready have working fpc (fpc-2.6.0 for lazarus-1.0.4) and lazarus dependencies. btw there is rpm package in here ---------------------------------------------------------------------- Kamau · 2012-12-22 09:50 I can surely try that... On the other hand I suppose that the "problem" is not an IDE-problem but a compile-problem and as such, the solution must have something to do with fpc? /Kamau ---------------------------------------------------------------------- theo · 2012-12-22 10:05 Quote from: Kamau on December 22, 2012, 10:50:00 amI can surely try that... Yes, try that. It's probably a configuration problem. And version 0.9.26 is really old (2008) http://en.wikipedia.org/wiki/Lazarus_%28IDE%29#Versions ---------------------------------------------------------------------- Kamau · 2012-12-22 10:49 One problem.... The version fpc-2.6.0 seems only to be available for 686 and I need to use it on a 386 machine. /Kamau ---------------------------------------------------------------------- Leledumbo · 2012-12-22 11:01 QuoteThe version fpc-2.6.0 seems only to be available for 686 and I need to use it on a 386 machine.FPC supports as old as i386What processor is your computer running on? ---------------------------------------------------------------------- Kamau · 2012-12-22 11:21 It is an Intel Celeron in an ASUS Eee PC 900. /Kamau ---------------------------------------------------------------------- Leledumbo · 2012-12-22 12:35 Celeron should be i686 ---------------------------------------------------------------------- Kamau · 2012-12-22 15:31 The CentOS 5 operating system which I have installed on that machine is 32 bit. (i386) /Kamau ---------------------------------------------------------------------- BigChimp · 2012-12-22 15:38 Yes, that's nice. the i386 in CentOS means it runs on any processor that supports the i386 instruction set, including i386, i486, pentium, pentium pro, pentium II, pentium 3, celeron, xeon, Pentium IV, core, core duo etc processors. https://en.wikipedia.org/wiki/I686 So you can install FPC 2.6 on that very well. ---------------------------------------------------------------------- marcov · 2012-12-22 15:59 First, update to the newest version of course, but second, could you give some examples of absolute usage? If you mean absolute usage like var videobuffer : array [0..43] of byte absolute [ $0b800:0] ; or something, that is a syntax reserved for DOS. It will only work in TP dialect mode on the dos platform (and of course, the addresses used have no meaning on non-dos operating systems to begin with) ---------------------------------------------------------------------- Kamau · 2012-12-22 16:48 As I already said, it is not my code. It concerns surce wich is part of Lazarus/fpc Example: In the file "custombitmap.inc" included in Lazarus/fpc. procedure TCustomBitmap.SetSize(AWidth, AHeight: integer); var   SCB: TSharedCustomBitmap absolute FSharedImage;   CurIntfImage, NewIntfImage: TLazIntfImage;   NewRawImage: TRawImage; begin .....  The "FSharedImage" is not a variable in same file but a type. There are several occurences of this type of declarations in more files belonging to Lazarus/fpc. So, logically, there must be a way to work around this error-message. /Kamau ---------------------------------------------------------------------- theo · 2012-12-22 17:04 Quote from: Kamau on December 22, 2012, 05:48:07 pmSo, logically, there must be a way to work around this error-message. Upgrade, please. ---------------------------------------------------------------------- marcov · 2012-12-22 20:09 I think Theo is right. First, fsharedimage is a field, not a type. Apparently very old FPC's didn't support absolute to a field, only to global and local variables. So the recommendation is to upgrade FPC to 2.6.0 and lazarus 1.0.4 ---------------------------------------------------------------------- Kamau · 2012-12-22 20:24 All nice and well, and I get the message. BUT! As it is I would need an FPC 2.6.0 suitable for i386. At this point in time I can't upgrade the CentOS to a 64 bit system. I'ts all right. Thanks. /Kamau ---------------------------------------------------------------------- theo · 2012-12-22 20:37 i686 is not x86_64. Only the latter means 64bit. ---------------------------------------------------------------------- Leledumbo · 2012-12-23 04:16 Pentium II is already i686, FYI. And of course, it's not 64-bit in any way ---------------------------------------------------------------------- Kamau · 2012-12-23 04:45 Just want to round off this topic with a summary. Starting with again thanking the Lazarus and FPC teams for the fantastic job they have done and are doing! Here follows the solution to my initial question. "How to run Lazarus on a Centos 5 system?" Preparation: Be sure to uninstall both any previous Lazarus and any previous FPC before following the instruction below. rpm -e lazarus rpm -e fpc 1. FPC 2.6.0 can be installed on Centos 5, but I found no RPM's for i386. Solution: Use fpc-2.6.0.i386-linux.tar which can be downloaded from FPC's site. There is a binary.i386-linux.tar included. When you unpack it you find an install.sh which executes and installs fpc-2.6.0 NOTE: The RPM's provided on the Lazarus site, ex: fpc-2.6.0-2.fc17.i686.rpm, can not be used on CentOS 5. The reason is that they require epel6 which is not compatible with CentOS 5. 2. After installing FPC 2.6.0 the Lazarus RPM lazarus-1.0.4-0.i386.rpm on the Lazarus site can be used. It can not be installed with yum as it specifies dependencies wich require files non-compatible to CentOS 5. It can be installed using rpm: rpm -i --nodeps lazarus-1.0.4-0.i386.rpm It installs perfectly, without any problems. 3. Before running Lazarus If you had a previous installation of Lazarus you might want to get rid of your old configuration which can be found in your home- directory. If you run lazarus as root this is what you can do: Log in as root in a terminal. Remove the .lazarus directory by rm -rf .lazarus You are now ready for a fresh start and as already said... It runs perfectly. /Kamau