User:Swen/Installing Lazarus

From Lazarus wiki
Jump to navigationJump to search

This page is under construction.

Introduction

Lazarus System Requirements

Dowload locations

stable versions: Sourceforge]

snapshots: lazarus.org

should the ftp adress be listed?

Installing under Linux

General

Ubuntu

The current version 8.04 contains a Lazarus package. This package can easily be installed via Synaptic. Only the fpc-source package is not defined as dependency. So you have to install this package separately.

Alternatively the repository from www.hu.freepascal.org can be used (this repository is maintained by Vincent Snijders).

Short version: get Lazarus

In the sections that follow, there's a complete list of the commands you need to type at the console to download and install Lazarus on an Ubuntu system. If you're impatient, this section will just give you what you need to get it installed without going through every part of the process line by line.

Select and copy the following script, and save it as a file in your home directory named getlaz:

 #!/bin/sh
 gpg --keyserver hkp://pgp.mit.edu:11371 --recv-keys 6A11800F
 gpg --export 6A11800F | apt-key add -
 echo "deb http://www.hu.freepascal.org/lazarus/ lazarus-stable universe" \
     >/etc/apt/sources.list.d/lazarus.list
 apt-get update
 apt-get install lazarus

At the shell prompt, type this to prepare the script for execution, and to execute it (you can copy these lines and paste them into your shell using Shift+Insert):

 chmod +x getlaz
 sudo ./getlaz

The process will download around 100Mb of data from the Lazarus repository and the standard ones. It will take at least five minutes, even with a fast connection. Any time it stops to ask for confirmation of any step, answer "Y" for yes.

When it finishes and returns to the shell prompt, you're set. Look in the "Development" section of your Ubuntu menu; Lazarus will be there and functional.


Now, for completists, here's the same instruction step by step. You can ignore it if you followed the above instructions successfully. Please remember to come back to the wiki and put in any tested, reliable changes that might clarify this section!

Add the key

Download the key from the public key server:

 gpg --keyserver hkp://pgp.mit.edu:11371 --recv-keys 6A11800F

Add it to the apt system:

 gpg --export 6A11800F | sudo apt-key add -

You can see the list of apt keys with:

 sudo apt-key list

Add the repository

You can use synaptic for this or edit the /etc/apt/sources.list directly. For the stable repository, add the line:

 deb http://www.hu.freepascal.org/lazarus/ lazarus-stable universe

Or using a console app. do:

 echo "deb http://www.hu.freepascal.org/lazarus/ lazarus-stable universe">/etc/apt/sources.list.d/lazarus.list

For the testing repository:

 deb http://www.hu.freepascal.org/lazarus/ lazarus-testing universe

Or similarly, using a console app. do:

 echo "deb http://www.hu.freepascal.org/lazarus/ lazarus-testing universe">/etc/apt/sources.list.d/lazarus.list

Install Lazarus

Now You can install Lazarus with apt:

 apt-get update; apt-get install lazarus

Mandriva (needs to be updated)

Lazarus 0.9.22 on Mandriva 2007 (2007.0) (i386) (GTK-1)

Installation in Mandriva is very easy. However, there are a few points to check as the installation proceeds. Here is a typical installation using the .tar modules (see the trick for the theme at the end of the procedure!):

- During the Mandriva installation, select the "Gnome desktop" group. Although you will use lazarus in KDE or other desktop, this will install some GTK modules needed by the lazarus environment.

- Install the FPC 2.0.4 compiler using either the .rpm or .tar, modules. Using the .tar modules you would type: "sh install.sh" then RETURN many times. I do this in superuser mode.

- Install the compiler source code. just untar the file "fpc-src-2.0.4.source.tgz" in the folder /usr/local/src/fpc/ then rename the created folder "fpc" to "2.0.4" . When complete, you have the folder /usr/local/src/fpc/2.0.4/ that contains all the source code. The source code is only needed by lazarus editor, but you can recompile FPC and have an optimized version of the libraries, and show that everything is working well:

- If you want to compile FPC (optional), then go to the FPC source directory (/usr/local/src/fpc/2.0.4/) and type "./configure", "make clean","make all","make install","make clean". FPC is now installed. Check the content of "/etc/fpc.cfg". This file has to be modified when the make fails.

- Lazarus can be installed in user mode: just unzip/untar the file "lazarus-0.9.22.0.tar.gz" in your user directory. Then just type "make clean all" in the user mode. The last phase of the process (link) usually fails due to missing lbrary files:

- Check in the directory /usr/lib/ for the following symbolic links:

libglib.so -> libglib-1.2.so.0

libgtk.so -> libgtk-1.2.so.0.9.1

libgdk.so -> libgdk-1.2.so.0.9.1

libgdk_pixbuf.so -> libgdk_pixbuf.so.2.0.0

The file "libgdk_pixbuf.so.2.0.0" is included in the module "libgdk_pixbuf-2.0.22.0-10mdv2007.0.rpm" This file name is critical. In particular, DO NOT use "libgdk_pixbuf-2.0.so.0" (misleading isn't!).

After all the links have been fixed, the "Linking ../lazarus" stage will not crash any more and the "./lazarus" command should start the program!

- Go to the "environment/environment options" menu and change the "FPC source directory" to /user/local/src/fpc/2.0.4

USEFULL TO KNOW:

- The last step is to fix the theme. The package "galaxy-gnome-1.0.4-3mdv2007.0" is available in the Mandriva control center. Install it.

- The package "gtk-theme-switch-1.0.1-4mdv2007.0.i586.rpm" is available on the web! (strangely it did not show in the control center) Install it manually by typing "rpm -iv --test gtk-theme-switch-1.0.1-4mdv2007.0.i586.rpm" then retype the line without the "--test" in my case there was a warning message related to the signature. I decided to ignore it!

- in the USER MODE, type "switch", then chose "galaxy" theme.

The Lazarus / FPC tool is now installed!

Lazarus 0.9.20 on Mandriva 2007/or -2006 32 bit

Write this urpmi-command as root:

urpmi http://surfnet.dl.sourceforge.net/sourceforge/lazarus/lazarus-0.9.20-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-2.0.4-0.i586.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-docs-2.0.4-0.i586.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-src-2.0.4-0.i386.rpm

It seems like Lazarus 0.9.20 depends on fpc 2.0.4, and Mandriva 2007 is shipped with fpc-2.1.1-0.2mdk.i586. To prevent your system to upgrade to fpc-2.1.1 or newer in the future, when you run commands as urpmi --auto-select, you can write fpc in /etc/urpmi/skip.list.

Lazarus untested snapshot on Mandriva 2007 32 bit

urpmi $(for RPM in $(lynx --source http://michael-ep3.physik.uni-halle.de/Lazarus/ | grep i386.rpm | cut -d '"' -f 4-4) ; do echo -n http://michael-ep3.physik.uni-halle.de/Lazarus/$RPM ' '; done )

Installing Lazarus + fpc for Mandriva 2007 X86_64

This has worked for Mandriva 2007.0 X86_64 (AMD X2 4800+)

fpc-2.0.4-20061006.x86_64.rpm
fpc-src-2.0.4-20061006.x86_64.rpm
lazarus-0.9.19-20061006.x86_64.rpm
  • To install the current snapshot:
urpmi $(for RPM in $(lynx --source http://michael-ep3.physik.uni-halle.de/Lazarus/ | grep 64.rpm | cut -d '"' -f 4-4) ; do echo -n http://michael-ep3.physik.uni-halle.de/Lazarus/$RPM ' '; done )
  • Once the RPMs have been installed. Run lazarus for the first time. It will pop up a dialog complaining that the "/usr/bin/ppc386" and "/usr/lib/lazarus" are not valid. Accept ("OK") the alternate choices it suggests.
  • When compiling your first project, you may find that lazarus complains of missing libs (e.g. gdk, glib, etc.). Install the necessary libs as needed, I installed these (that I recall, YMMV):
glib-devel
lib64gtk+1.2-devel
lib64gtk+2.0_0-devel
lib64gdk-pixbuf2
lib64gdk-pixbuf2-devel

Slackware

Installing Lazarus 0.9.24, for Slackware 12.0 users

This have worked in Slackware-12.0 on a Pentium-3 computer:

  • The Free Pascal Compiler (FPC) is installed in SUPERUSER mode
  • The lazarus in installed in USER mode
  • The FPC compiler will be recompiled
  • The lazarus Integrated Development Environment (IDE) source code is loaded from the SVN server
  • The GTK-2 widget set is used ("LCL_PLATFORM=gtk2")

-- Download "fpc-2.2.0.i386-linux.tar" in a user folder and install it. Go to this folder and type:

 bash-3.1$ tar -xvf fpc-2.2.0.i386-linux.tar
 bash-3.1$ su 
 bash-3.1$ password:xxxxxx
 bash-3.1# sh install.sh
 ...
 (use the default answers for the next 6 questions: press "return" 6 times)
 ...
 bash-3.1# exit
 bash-3.2$ fpc
 free pascal compiler version 2.2.0 [] for i386 
 Copyright (c) 2007 ...
 ...
 ...

You have installed the compiler. You may want to recompile it or not, but in any case you will need to download the source code as it is required by the lazarus IDE.

-- Download "fpc-2.2.0.source.tar.gz" in a temporary folder. If you do not want to recompile the source then just skip this section. If you would like to run your own compiled version of FPC, then just type:

 bash-3.1$ tar -xvzf fpc-2.2.0.source.tar.gz
 bash-3.1$ cd fpc-2.2.0
 bash-3.1$ make clean all
 bash-3.1$ su
 bash-3.1$ password: xxxxxxxx
 bash-3.1# make install
 bash-3.1# exit
 bash-3.1$ fpc
 free pascal compiler version 2.2.0 [...] for i386 
 Copyright (c) 2007 ...
 ...
 ...

Now you have your own compiled version working.

-- The lazarus IDE editor needs to look at the FPC source code. Even if you do not want to recompile FPC, you need its source code. However, in order to save some space, I only keep a clean (not compiled) copy of the source code. I start from the file "fpc-2.2.0.source.tar.gz" again and I copy it to the /usr/local/src/FPC folder:

 bash-3.1$ su
 bash-3.1$ password: xxxxxxxx
 bash-3.1# cp fpc-2.2.0.source.tar.gz /usr/local/src/
 bash-3.1# cd /usr/local/src/
 bash-3.1# tar -xvzf fpc-2.2.0.source.tar.gz
 bash-3.1# rm fpc-2.2.0.source.tar.gz
 bash-3.1# exit

The version number is included in the folder name "fpc-2.2.0". This way I can keep many versions the the compiler source and eventually switch between them.

-- The lazarus IDE is kept in my USER "~/lazarus" folder and always compiled in USER mode. I usually download the "lazarus-0.9.24-0.tar.gz" file, but here we can also get the latest development version from the SVN server:

  bash-3.1$ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus

This is for the first time you load it. Next time you will only need to type:

  bash-3.1$ svn update

If you do not have SVN installed on your computer, here is how to get it quickly:

--Download the two files: "subversion-1.4.6.tar.gz" and "subversion-deps-1.4.5.tar.gz" (or later versions). Type:

  bash-3.1$ tar -xvzf subversion-1.4.6.tar.gz
  bash-3.1$ tar -xvzf subversion-deps-1.4.6.tar.gz
  bash-3.1$ cd subversion-1.4.6
  bash-3.1$ ./configure
  bash-3.1$ make
  bash-3.1$ su
  bash-3.1$ password:xxxxxx
  bash-3.1# make install
  bash-3.1$ exit

-- At this point you have the folder "~/lazarus" containing the source code. You should compile it very simply:

  bash-3.1$ make clean all LCL_PLATFORM=gtk2

The "LCL_PLATFORM=gtk2" means of course that you will develop your applications in GTK-2. The default widget set for lazarus is GTK-1 but you will not be able to use it in Slackware 12.0. I strongly recommend that you use the "LCL_PLATFORM=gtk2" option now. After a few minutes, the compiler stops:

  ...
  ...
  Linking ../Lazbuild
  987 linescompiled ...
  make [2] leaving ...
  make [1] leaving ...
  bash-3.1$

-- Just type:

  bash-3.1$ ./lazarus

WOW! You get a message: "Free Pascal sources not found". Just follow the instructions and indicate your Free Pascal Compiler source directory in the panel: "Environment->Environment_Options->Files". As explained earlier, on my computer this should point to "/usr/local/src/fpc-2.2.0". Note that when you change this folder, you should click on "Environment / Rescan_FPC_source_directory".

Voila!

Suse (needs to be updated)

Installing Lazarus 0.9.18. For Suse 10.1 users

This have worked on SUSE10.0 and FC5.

Start Linux and login as "Root"

Free Pascal Compiler requires:
- Gnu binutils (gnu as, gnu ld, gnu make) - check it out with "YAST"

Download these binary files (RPM)

  • fpc-2.0.4-0.i586.rpm (yes i586 and not i386)
  • fpc-src-2.0.4-0.i386.rpm

install them opening a terminal session (mouse's right button -> Menu: Open in terminal)

  • rpm -Uvh fpc-2.0.4-0.i586.rpm
  • rpm -Uvh fpc-src-2.0.4-0.i386.rpm

Lazarus requires these components: 1) glib devel 2) gtk devel 3) gdk-pixbuf-devel 4) gtk+-devel.

Important: The lazarus rpm requires the gtk 1 or 1.2 version, not the version 2 of the above packages.

The last component seems does not work with Suse, then once we have installed the first three components we can force installation with -nodeps option:

  • rpm -Uvh --nodeps lazarus-0.9.18-0.i386.rpm

Note: If you did not install the devel packages, you can setup the links yourself (/opt/gnome/lib):

 libgtk-1.2.so.0 -> libgtk.so
 libglib-1.2.so.0 -> libglib.so
 libgdk-1.2.so.0 -> libgdk.so
 libgdk_pixbuf.so.2.0.0 -> libgdk_pixbuf.so

These filenames are for OpenSuSE 10.2.

Fedora

Lazarus is part of the standard Fedora-repositories since Fedora version 9. You can install it using the command-line ('yum install lazarus') or by using the 'add/remove software' wizard. If you want to install Lazarus during the installation of Fedora, you have to enable the additional repositories during install.

Once installed you can find Lazarus in the 'Applications/Programming' menu.

Note that if you want to develop gtk2 applications, you also have to install 'gtk2-devel'.

Debian (needs to be updated)

Another way to install Lazarus under Debian

Added by User:Kirkpatc.

Simple Lazarus Installation in Debian

(assume new Debian installation, without development libraries loaded)

From sourceforge repository, download latest fpc, fpclib and lazarus releases; follow links from http://lazarus.freepascal.org, click the "downloads" button on the left, then click on "binaries" then "linux" then "Current Lazarus RPM". This will bring you to

http://sourceforge.net/project/showfiles.php?group_id=89339

then download the following files (or more recent, if available)

  • fpc-2.0.0-0.i586.rpm
  • fpcsrc-2.0.0-0.i386.rpm
  • lazarus-0.9.8-fpc_2.0.0_0.i386.rpm

cd to the directory where these files are stored, then become root (su) and type:

alien -c fpc*     //this will convert both the fpc and fpcsrc files to debian format and convert the install scripts
alien -c laz*

then install the generated Debian (.deb) packages by (as root):

dpkg -i fpc*.deb laz*.deb

or use kpackage or a similar utility to install the generated fpc, fpcsrc and lazarus .deb files.

And if you do not have alien type:

apt-get install alien 

Please note that, on Linux distributions like Ubuntu, you'll have to add 'sudo' in front of all commands. In Ubuntu previous command would be

sudo apt-get install alien

You need to produce a configuration file, which will reside in /etc/fpc.cfg. Still as root, cd to the main fpc directory /usr/lib/fpc/2.0.0 and then type

sh ./samplecfg /usr/lib/fpc/2.0.0 /etc

Check the contents of your new configuration file (cat /etc/fpc.cfg) and make any changes you want using vi or another text editor. Also make sure that there are no old configuration files in for example your home directory (~/.fpc.cfg).

You need to install the development packages of the GTK and pixbuf libraries, so

apt-get install libgtk2.0-dev
apt-get install libgdk-pixbuf-dev

Then you should be ready to start programming!

Installing under Windows

Installing Free Pascal under Windows

FPC Binaries for Windows

By far the easiest way to get a working installation of Free Pascal is to download the current binary Windows release of Lazarus from the SourceForge repository - the release contains the current versions of the FreePascal compiler and the FreePascal libraries as well as the lazarus IDE. If you want to install from sources, read on!

You can get the installer zip for fpc 2.2.0 at Free Pascal's download section http://www.freepascal.org/download.html, then choose a mirror). Installing from the sources -- see the next section to know how to get them -- is not for novices, since you need a starting compiler as well.

FPC Sources for Windows

<<<< See section above under FPC Sources for Linux, where the use of SVN is described >>>>

The easiest way to get the Free Pascal sources is via SVN; see the next section for more on that. You can also download the package as a whole -- see http://www.freepascal.org/develop.html for the daily snapshot of the 2.3.x release tree.

Windows FPC Sources via SVN ()

You will need to have a SVN client such as TortoiseSVN installed in order to perform the steps below. The exact commands vary between SVN clients; the ones given below are to be used under SVN home's client, which is available for download here.

First create a directory in which you'd like to put the sources. Any normal user can do this. Create a directory for fpc (e.g. C:\Source), then do the following at the command prompt:

 C:\Source> svn co http://svn.freepascal.org/svn/svn/trunk fpc

Hint: To download/update the latest changes you can simply do

 C:\> cd Source\FPC
 C:\Source\FPC> svn up

ToDo: Write me.

See: http://www.freepascal.org/down-win32.html . You can find a list of mirrors at http://www.freepascal.org/sdown.html. Download FPC as one big file, unzip it and run the install.exe.

Extending your PATH variable to the fpc directory:

  • Win98: Edit autoexec.bat and add the line: PATH=%PATH%;C:\pp\bin\bin\win32
  • WinXP/2k: My Computer (Right Click) -> Properties -> Advanced (Page) -> Enviroment Variables -> System Variables -> Edit "PATH", Add "C:\pp\bin\bin\win32" there.

Then restart windows.

ToDo: Explain how to download fpc sources and build the compiler

Using TortoiseSVN for Windows

TortoiseSVN integrates itself with Windows Explorer. After installation, all commands are available from inside Windows Explorer through right-clicking on a directory or file.

Check out a working copy using TortoiseSVN, go to Run and paste the command below:

tsvn:http://svn.freepascal.org/svn/lazarus/trunk

To get Lazarus for the first time:

  • Open Windows Explorer
  • Create a directory where you want to put the files from the SVN server
  • Right click on the newly created directory
  • Select SVN Checkout... on the popup menu

TortoiseSVN Main Menu.png

  • In the next dialog you enter the URL for Lazarus server source:
http://svn.freepascal.org/svn/lazarus/trunk
  • Watch how TortoiseSVN imports the file tree from the server. This can take some time to complete.


To update Lazarus sources:

  • Open Windows Explorer
  • Right click on the source directory
  • Select SVN Update on the popup menu

TortoiseSVN Main Menu Update.png

Installing under BSD (needs to be updated)

FreeBSD 5+

The latest version of Lazarus into FreeBSD port tree is 0.9.22. We can to install lazarus using FreeBSD ports.

[]# cd /usr/ports/editors/lazarus && make install clean clean-depends

If you get the messages about missing source files, go to [menu bar >> Environment >> Environment Options >> Files Tab: FPC source library] and enter the directory of the FPC source files. It can be obtained from /usr/ports/distfiles/freepascal

Good luck, that worked for me. --Jrmarino 21:29, 4 Jan 2006 (CET)

PC-BSD 1.0rc1+

You can install Lazarus on PB-BSD by simply downloading the Lazarus PBI from PBI Dir

Note that you must install glib* port from /usr/port/devel/glib* or glib packages by pkg_add -r glib12 glib20. I will fix this in new PBI releases.

[other OpenBSD/NetBSD/DragonFlyBSD goes here]

Installing under Mac OS X

Unfortunately, there is no native Aqua-version of Lazarus for Mac OS X.

Required software

  • Install Apple´s X11, available on your Mac OS X Installation Disk.

For Mac OS X 10.2.x you can download X11 on source forge at the X11 on Mac OS X Project.

For Mac OS X 10.3.x (but not for any other Mac OS X version!) also at Apple.

For Mac OS X 10.4 Tiger you must install X11 from your tiger DVD. This is for OS X to be able to display X11 programs. Tip: Drag the X11-Icon from /Applications/Utilities/X11 into the Dock for convenient starting.

  • Install Apple´s XCode, available on your Mac OS X Installation Disk or at Apple Developer Connection (requires creation of account, but the free online program is enough). This installs the XCode IDE and all the developer stuff.
  • Install fink, available at Sourceforge. This is an OS X 'apt-get'esque package system.
  • Check if installation was successful, open a Terminal and type:
 echo $PATH

This should give you:

 /sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin

  • After successfull installation of the above, open a Terminal and type:
sudo apt-get update
sudo apt-get install glib glib-shlibs gtk+-shlibs gdk-pixbuf gdk-pixbuf-shlibs


This installs GTK.


If you decide not to use Fink or if your Fink installation is customized

If you install gdk-pixbuf, gtk, and glib libraries not using Fink, or if your Fink installation is customized to install under other than /sw directory, then make sure that the environment variable DYLD_LIBRARY_PATH point to where the libraries are. For instance, if you use MacPorts, the command below should do the trick:

export DYLD_FALLBACK_LIBRARY_PATH="/opt/local/lib:$DYLD_FALLBACK_LIBRARY_PATH"

The environment variable should be setup every time before running lazarus, or should be run from shell startup script.

How to get going

Mac OS X up to 10.4

  • Start X11.
  • You get your XTerm. Focus it and type
cd /usr/local/share/lazarus/
./lazarus

Mac OS X 10.5

  • Start Terminal.app.
  • Type
cd /usr/local/share/lazarus/
./lazarus

Actually, Lazarus has become a double clickable application in/usr/local/share/lazarus/.

Lazarus as Icon

You can drag and drop the X11 app onto your dock to have a one-click way of starting X11.

To simplify starting Lazarus, in X11, choose Applications | Customize Menu, then click Add. Under Menu Name enter Lazarus, under Command enter the following:

/usr/local/share/lazarus/lazarus

Click Done to close. Now you can start Lazarus from X11 simply by choosing Applications | Lazarus.

BEWARE: if you use the below svn, then use

 open -a /Users/yourname/pascal/lazarus/lazarus


How to update fpc and Lazarus to the newest version

Additional experiences and advices

On linux, getting Lazarus to work can be complicated if you have an older version installed. If you have already installed earlier versions of FPC and/or Lazarus, you have to take great care that the PATHS are adjusted so that only your new versions are called.

Pitfalls that I have experienced in various attempts with SuSE linux include:

The rpm versions often install FPC in /bin or /usr/bin, with the libraries in /lib or /usr/lib.

If you perform a make install on a source version or use a .tar.gz, the compiler is usually installed in /usr/local/bin with the libraries in /usr/local/lib.

So if earlier versions have been installed from rpm, make sure all links are changed to reflect the directory structure of your new compiler. The place to make the changes is in /etc/fpc.cfg ; make sure there are no remnant configuration files in your home directory or in your FPC download directory. Typically they are found in ~/.fpc.cfg

Make sure the links in /etc/fpc.cfg point to the correct versions of the libraries (particularly if you have older versions still lurking around).

In /usr/local/bin or /usr/bin there is a file called fpc ; this is the executable that is called when you invoke the compiler. One of the first things it does is to open ppc386 in the same directory. This has to be the same version as the fpc file, or can be a link pointing to the true ppc386 in some other directory (such as a library directory, or the fpc directory in your own development space); be sure to update your link if you install a newer version of the compiler.

Try running the compiler from the command line using one of the simple example programs or one which you wrote yourself.

Turning to Lazarus:

If you use a downloaded snapshot (.tar.gz) or get the source from CVS, enter your lazarus directory and type

make
./lazarus 

and hopefully the IDE should load. There may be a message saying it can't find the sources; if so, go to the menu at the top and select Environment -> Environment options and insert the name of the directory where you expect to find your lazarus files (eg ~/FreePascal/lazarus), your compiler (e.g. /usr/local/bin/ppc386), the FreePascal source directory (e.g. /usr/local/lib/fpc/$version/fpc or a directory in your own space e.g. ~/FreePascal/fpc). Then close the dialog and start programming.

You may find further problems when you start programming or compiling; most of these will be related to PATH selection.

Many of the difficulties are dealt with in the Lazarus FAQ, found either on this WiKi site, or a more complete list on the main Lazarus site

http://www.lazarus.freepascal.org/modules.php?op=modload&name=FAQ&file=index

From the top menu select Run -> Compiler Options (or Project -> Compiler Options in more recent releases of Lazarus) and select the Paths tab on the resulting dialog. There are several boxes for entry of paths for Unit files, Include files, Other source files, Libraries etc. For each of these, it is worth pressing the ... (ellipsis) button on the right, and you will be given a blank window for inserting path information, and a lower window giving some suggestions. Select as many as you like (or ALL!) and press the ADD button to transfer the selections to the upper window. When your selection is complete, press OK and move on to the next box. If you know of other paths which need to be followed, press the Browse button associated with each box, and insert the additional paths.

When you think you have got your paths right, try to compile your application. If there are further path-related errors ('can't find unit .......') then go back and check your paths, both in /etc/fpc.cfg and in your Run -> Compiler Options dialog (or Project -> Compiler Options depending on your version).

Once you have got the environment and PATHS correct, it is worth saving the settings to a file, otherwise you will have to go through this process for each new project. In the Run -> Compiler options dialog there is a Load/Save button; select this and then save the setings to the filename of your choice: mine is ~/FreePascal/default.cfg. Then each time I start a new project, I can go to the Run -> Compiler Options dialog (or Project -> Compiler Options), select Load/Save, and load my default.cfg file to the new project. You can, of course, modify the options for each new project if you so desire.

Contributors

  • Initially imported and formatted. VlxAdmin 9/22/2003
  • Changed Joe's part for Windows to require fpc 1.0.10. Vincent 9/25/2003
  • Updated "What is required for lazarus". AndrewJohnson 10/1/2003
  • Finished formatted the InstallingLazarus page VlxAdmin 2/22/2004
  • Posted some notes about Installing FPC and Lazarus: mostly reflecting experiences in trying to get the PATHS right in Linux. 3/11/2004 User:Kirkpatc
  • Copied the contents of my note into the main InstallingLazarus section, edited it slightly. I don't know how to remove the original note. 3/12/2004 User:Kirkpatc
  • Removed the original note. Tidied the wiki and formatting a bit. VlxAdmin
  • Corrected a couple of typos - 3/12/2004 User:Kirkpatc
  • Added link for daily snapshot deb packages - 3/27/2004 Vincent
  • Fixed links in GettingLazarus (downloading binaries) and several other pages. 22 July 2004 User:Kirkpatc
  • Added link for lazarus deb packages - 19 August 2004 VincentSnijders
  • Added a short note on installing in Debian - 23 Nov 2004 User:Kirkpatc
  • Considerable re-write and re-organization of installation section - 11 Dec 2004 User:Kirkpatc
  • Fixed broken link - 9 Oct 2005 User:Avantman42
  • Install Under Slackware - 10/02/2008 User:Amiso