# Talk:Installing Lazarus

### forget .rpm and .deb - use fpcup_linux_x64 instead

unless you want to waste tons of time, just go straight for fpcup and don't even consider apt-get or synaptic, which in 99% of the cases won't get you anywhere near a working Pascal IDE.

People who see this page for the first time must go crazy! It's much too complex, various ways of doing things etc.

Why not split out

- the generic/manual part of installing FPC+Lazarus (e.g. from SVN etc)

- links to platform specific articles with the shortcut ways and tweaks

However I'm not going to do it - I tried to streamline this page in 2011-2012 and failed as people kept adding different procedures, so I'm just putting this out there as a suggestion. --BigChimp 07:14, 17 April 2013 (UTC)

### This page is getting to be a mess again - BigChimp January 2011

Seems somebody is adding info on compiling Lazarus on Windows.

Fine by itself, but we still have the integrated stuff originally from Marcos Douglas (FPC+Laz), so we're getting redundancy and IMO confusion.

Might be best if somebody extracted the Lazarus part out of Marcos' section and put that into the Lazarus section.

Also, I'm not sure if the new Windows Lazarus source section should specify using windres and don't understand the story about using GNU make on other drives than C...

### Posted by Claude Rieth on October 31, 2003 at 00:58:59 PST

Installing on a Debian Woody:

As it is RPM packages I installed them using

rpm -i --nodep

needed to create a directory first to get rpm running but then it went okay.

To be able to use the compiler, I had to manually simlink

libX11.so -> libX11.so.6 libgtk.so -> libgtk-1.2.so.0.9.1 libgdk.so -> libgdk-1.2.so.0.9.1 libXi.so -> libXi.so.6.o libXext.so -> libXext.so libglib.so -> libglib-1.2.so.0.0.10

And then it worked. Actually coding my usual NEW ENVIRONMENT PROJECT, a RPN calculator, will post it when ready.

BTW: To the maintainer of TPanel, TCustomPanel, with the VCL, if I set the Borderwidth to 2 (ex.), the caption of the panel is moved that far away from the border (at least in Delphi 6), so it becomes more readable, this can easily be done in the LCL by adding another inflateRect(...,-BorderWidth,-BorderWidth) just before the Textout(...) that does the caption, but as I do not know yet how to add this to the offical LCL source codes, I just put it here.

Regards,

Claude

### Posted by Installing on Debian on July 8, 2004 at 10:28:35 PDT

This is my version how I successfully installed Lazarus on Debian.

Installing FPC:

Download fpc-1.9.x.i386.tar (in my case x was 4) and unpack the archive. Go into the folder in which you had unpacked FPC and type (as root if needed) "./sh install.sh". Follow the instructions of the script (I simply install all packages). You have now successfully installed FPC.

Installing gtk+: type as root: "apt-get install libgtk1.2-dev" this will install gtk+. then install gdk-pixbuf with the command: "apt-get install libgdk-pixbuf-dev"

Installing Lazarus:

First download lazarus-040529.tgz (or a file with a newer version number) and unpack the archive. Go to the folder with the unpacked files and enter "make clean all" (you do not need to be root). Compiling will need a good minute on a 1GHZ PC. If all works well you can start lazarus with ./lazarus.

If you get errors at the end of the compiling, possibly you have not all needed packages installed. Try to find out how to install the missing packages and try to compile again. At my first try libgtk1.2-dev was missing, at the second try it was libgdk-pixbuf-dev, the third try successfully build Lazarus.

Wine:

If this was too difficult to you, you could try out the Windows version of Lazarus with wine. It works (without a Windows installation), I've wrote and started a "Hello World" program within three minutes after downloading the Windows version.

Happy programming :-)

Malte

### Posted by Olivier Garet on August 17, 2004 at 01:43:21 PDT

Installing on debian

In fact, it seems that the current CVS is ready for building a debian package.

=> dowload lazarus.zip , unzip it, cd to the directory lazarus.

Verify that the fpc-* packages are installed.

Now

chmod +x debian/rules touch fpcdebug.txt dpkg-buildpackage

You should now get a package lazarus_0.9.1beta-0_i386.deb

Verify that the package tct is NOT installed (it has a /usr/bin/lazarus file !)

Now, dpkg -i ../lazarus_0.9.1beta-0_i386.deb should install the package.

Hope this helps.

### Posted by ridz on October 2, 2004 at 00:45:38 PDT

Installing on Slackware 10.0

fpc-1.9.5-040808.i386.rpm fpcsrc-1.9.5-040808.i386.rpm lazarus-0.9.2.2-fpc_1.9.5_041001.i386.rpm

2) Convert the 'rpm' files to Slackware 'tgz' format using

the rpm2tgz utility (usually installed as standard): rpm2tgz fpc-1.9.5-040808.i386.rpm rpm2tgz fpcsrc-1.9.5-040808.i386.rpm rpm2tgz lazarus-0.9.2.2-fpc_1.9.5_041001.i386.rpm

3) Rename the resulting 'tgz' files as follows in order

to satisfy Slackware package manager naming convention: fpc-1.9.5.040808-i386.tgz fpcsrc-1.9.5.040808-i386.tgz lazarus-0.9.2.2fpc195.041001-i386.tgz

4) Install all 3 using the 'installpkg' utility.

Enjoy! :)

NOTE: To uninstall 'lazarus' use the removepkg utility (dunno why anyone would want to un-install it!)

## Install Lazarus 0.9.4 on Mandrake 10.1

Do the following steps to install your Lazarus Integrated Development Tool, with the Free Pascal Compler.

I am a novice linux user. I find it so difficult to install or upgrade software on linux. This time I finally succeeded upgrading lazarus to the 0.9.4 version (3 jan 2005 version) and I hope that this sumary could be usefull for other novice users.

• System: linux "Mandrake 10.1 Official" on a Pentium III (or II) type computer.
• Lazarus: Version 0.9.4 (built: 3 january 2005).
• FPC: Version 1.9.6 (built: 2 january 2005).
• File names:
   File_1 = "fpc-1.0.10i386.tar" from:
http://www.freepascal.org/down-linux-1386.html

   File_2 = "fpc-1.9.6-050102.i386-linux.tar" from:
http://www.lazarus.freepascal.org
RPM"

   File_3 = "lazarus-050103.tgz" (from the lazarus site)

• System modules: Lazarus uses the GTK+ library (version 1 only, not version2). Go the "Mandrake Control Center" and install the modules:
      libgdk-pixbuf-xlib2-0.22.0-5mdk
libgdk-pixbuf2-devel-0.220.-5mdk



There are 3 steps:

   Step A - Install the stable compiler (V1.0.10)
Step B - Install the current compiler (V1.9.6)
Step C - Install the Integrated Development Environment (Lazarus)
Step A - Install the stable compiler (FPC Version 1.0.10)


### Step A - Install the stable compiler (FPC Version 1.0.10)

In order to compile the compiler, you need a compiler! We use the "stable compiler", (Free Pascal Compiler version 1.0.10) for that. It used to be included on the "Mandrake Install disk" but I did not find it in the Mandrake 10.1 distribution! However, it is available on the web (see the address above):

   A.1- In user mode ("myself") type: mkdir /home/myself/freepascal/V1.0.10
A.2- copy File_1 to /home/myself/freepascal/V1.0.10
A.3- type: tar -xvf File_1 (of course you type the actual
file name given above)
A.4- type: cd fpc
A.6- type: sh install.sh
A.7- you want to install it in the [/usr/local folder] then
just press: return
A.8- anwser "Y" to all the 11 questions, and answer "return"
to the last question.


At this point you shoud have the first "stable" compiler installed! It will be used to compile the "current" compiler: The command: "fpc" shows a help message that shows the "1.0.10" version number. Also, check that now you have the folder:

   /usr/local/lib/fpc/1.0.10/


### Step B - Install the current compiler (FPC Version 1.9.6)

This is very similar to the previous section:

   B.1- In user mode ("myself") type: mkdir /home/myself/freepascal/V1.9.6
B.2- move File_2 to: /home/myself/freepascal/V1.9.6
B.3- type: tar -xvf File_2 (actual name given above)
B.4- type: cd fpc
B.5- go to the superuser mode ("su")
B.6- type: sh install.shl (takes about 10 minutes)
B.7- anwser "Y" to all the 12 questions, and answer "return" to the last
question.


At this point check that you have a directory:

   /usr/local/lib/fpc/1.9.6/units/i386-linux/


filled with the libraries. There are all sort of folders in there. Now check that the file fpc.cfg has the lines:

   -Fu/usr/local/lib/fpc/1.9.6/units/$fpctarget -Fu/usr/local/lib/fpc/1.9.6/units/$fpctarget/*
-Fu/usr/local/lib/fpc/1.9.6/units/$fpctarget/rlt  Note that you see the word:$fpctarget NOT \$target. Note that you see: 1.9.6 NOT 1.0.10. If the lines do not match then edit and change the file. Use any editor you like of course. In VI (type: "vim") you type:

   B.7.a - "I" to go to the "insert" mode
B.7.b - type in your lines as shown above
B.7.c - press "ESCAPE" to go back to the command mode
B.7.d - type ":wq" to save and exit. (":q!" exit without save!)


The last "trick" is to check (and change, if necessary) that the symbolic link "ppc386" points to the good compiler. Type:

   B.8.a- cd /usr/local/bin
B.8.b- ls -al


The displayed line should show:

   ppc386 --> /usr/local/lib/fpc/1.9.6/ppc386


   B.8.c- rm ppc386 (then "y")
B.8.d- type: ln -s /usr/local/lib/fpc/1.9.6/ppc386
B.9 - Go back to the user mode (type: "exit").
B.10- type: fpc


Wonderfull! Now you see from the help message that you have the version 1.9.6 compiler. The last step is to load the IDE.

### Step C - Install the Integrated Development Environment (Lazarus)

The Lazarus can installed in your own user account ("myself"). That can be done in the user mode:

   C.1- type: cd ~
C.2- Copy File_3 to: /home/myself/
C.3- cd ~
C.4- tar -xvzf File_3 this will create the lazarus folder
C.5- cd lazarus
C.6- make clean all (takes about 10 minutes)
C.7- type: ./lazarus


This should bring up the IDE. The first time you run lazarus, you get an error message about a bad "Free pascal Source Directory". Click: "ignore", then go to the menu: "Enviromnment/Environment Options" and set the "FPC source directory" to /usr/local/share/src/fpc-1.9.6/.

   C.8- In order to check that the application is working properly,
create the simplest application. Just drag and drop a button on
the form and press F9.
C.9- Finally, create a shortcut icon on your desktop that executes lazarus
in the /home/myself/lazarus/ directory. Enjoy.


Finally, I would like to make a few comments:

• I do not know how to install the .rpm files. For that reason I always use the .tar files. Most people commented to me that the RPM file is a prefered method.
• There is a stable version 1.0.11 but there was no .tar file available for this one. The version 1.10 is available and works well, so I used it.
• If you get an error message about some files "missing" this is because you have not installed some modules. Instaling modules is an art (and a hobby)! Try to install the followings modules. I do not know if they are nessary but they were already installed on my system:
      kernel-source-2.6-2.6.8.1-12mdk
libgdk-pixbuf2.0-0-devel-2.4.9-9mdk

• Beware of the files "ppc386" "ppc396.cfg" "fpc.cfg" "fpc" when your instalation fails. After a while, you see them everywhere. Some of them are hidden sometimes! Remove all those files before you start the instalation again. Only /etc/fpc.cfg and /user/lib/ppc386 are necessary.
• FPC can be installed in the cross-compiler (multi-platform) mode. The file to use for that has the name structure "fpcsrc-...-.tar". I could install it, but more difficult to install. In this this procedure however, the "linux-only" file ("fpc-...-linux.tar") is very easy to install.

I hope that this was not too pedantic and could be usefull to someone.

I wish you a good luck.

Sincerely

Alain Michaud

31 january 2005

### Installing under X86_64

This is incredibly broken under X86_64 that I highly doubt you will be successful!

• The fpc units are not found by lazarus so that means you either create a semicoloned list of the /usr/lib/fpc/2.0.4/i386-linux/*/ dir names, then manually edit that into the project.lpi -- OR -- you spend much time clicking this into the "Project | Compiler Options | Other Unit Files".
• IOW, there appears to be no way to set a base dir so that tree search can be done to locate the missing unit. You have to explicity point lazarus / fpc to the Package.fpc file dir.
• fpc insists that it wants to link only with an i386 crtbegin.o instead of the X86_64 crtbegin.o that was installed as the system's gcc compiler!
• fpc source RPM will not build under X86_64 using rpmbuild. This is a chicken + egg problem, to compile fpc you need fpc. The fpc binary image from sourceforge throws an exception far into the compile process and terminates.
• Lazarus source will not build under X86_64 as it needs fpc.
• Essentially, use VMware and install a 32bit linux distro into that so you can use lazarus.
TomW, can you create bug reports for your problems. Did you try to install the x86_64 rpms from Lazarus Snapshots Downloads? Using the i386 version of the compiler on x86_64 is hard, but you made it more difficult by having wrong an incorrect or missing fpc.cfg. Rather that using the i386 version of the compiler and lazarus you should install a fpc rpm from the fpc team and use that to build a lazarus executable from source. Vincent 06:55, 5 October 2006 (CEST)

## Installing Free Pascal

Is the section 'Fixes to 2.0.x' still relevant? --Swen 16:08, 10 November 2006 (CET)

Yes, as can be seen in the logs, sometimes still patches are merged from trunk to the fixes branch even if there won't be a 2.0.6. Vincent 16:21, 10 November 2006 (CET)