Difference between revisions of "Installing Lazarus/sk"

From Lazarus wiki
Jump to navigationJump to search
Line 1: Line 1:
 
==Úvod==
 
==Úvod==
  
Pre tých, ktorí jednoducho chcú nainštalovať Lazarus a začať ho používať pre programovanie, je najjednoduchším prístupom stiahnuť a nainštalovať najnovšiu, podľa možností stabilnú, binárnu release (balíček ".exe").
+
Pre tých, ktorí jednoducho chcú nainštalovať Lazarus a začať ho používať pre programovanie, je najjednoduchším prístupom stiahnuť a nainštalovať najnovšiu, podľa možností stabilnú, binárnu verziu (linuxový balíček ".rpm alebo windowsový balíček ".exe"). Môžete si prečíteť časti pod Linux alebo Windows nazvané "fpc binaries" alebo prvé odstavece v časti o inštalácii Lazarus v Linuxe alebo vo Windows; väčšinu ostatných informácií môžete kľudne ignorovať.
 +
 
 +
Tí, ktorí sa chcú spolupracovať pri vývoji prekladača alebo IDE, alebo chcú mať najaktuálnejšie nástroje, budú potrebovať inštaláciu zo zdrojových súborov a väčšina zvyšných informácií je pre nich relevantná.
  
 
Lazarus pozostáva z dvoch základných častí:
 
Lazarus pozostáva z dvoch základných častí:
Line 9: Line 11:
 
Tieto v podstate závisia na:
 
Tieto v podstate závisia na:
 
* FreePascal – prekladač FreePascal
 
* FreePascal – prekladač FreePascal
* FCL – knižnica komponentov FreePascal (FreePascal Component library, obsahujúca väčšinu nevizuálnych komponentov použitých v Lazarus
+
* FCL – knižnica komponentov FreePascal (FreePascal Component library,obsahujúca väčšinu nevizuálnych komponentov použitých v Lazarus
  
 
===Systémové požiadavky Lazarus===
 
===Systémové požiadavky Lazarus===
Line 15: Line 17:
 
# prekladač FreePascal, balíčky a zdrojové kódy (*dôležité* rovnakej verzie/dátumu)
 
# prekladač FreePascal, balíčky a zdrojové kódy (*dôležité* rovnakej verzie/dátumu)
 
# podporovaný Widget tool-kit
 
# podporovaný Widget tool-kit
# môže byť použité pôvodné Win32 API
+
#:;Win32: : môže byť použité pôvodné Win32 API
 +
#:;Linux/xxxBSD: GTK+ 1.2.x : Most Linux distributions and *BSDs already install the GTK+ 1.2.x libraries. You can also find them at http://www.gtk.org. <br> You'll also want gdk-pixbuf, 0.13 or newer (preferably 0.18 or newer), which is also found in most recent distributions from the past 2 years. The source is available from ftp://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/
 +
#:;Mac OS X: GTK+ 1.2.x : You need the apple developer tools, X11 and GTK1.2. See below Installing under Mac OS X.
 +
#:;GTK+ 2.x: WARNING : The GTK2 interface is not yet complete and is only for testing purposes. <br> It's found in most recent distributions. For the source see http://www.gtk.org.
  
 
FAQ - Najčastejšiekladené otázky sú dostupné na http://www.lazarus.freepascal.org . Niektoré z otázok môžete nájsť v lokálnom súbore 'FAQ'.
 
FAQ - Najčastejšiekladené otázky sú dostupné na http://www.lazarus.freepascal.org . Niektoré z otázok môžete nájsť v lokálnom súbore 'FAQ'.
 +
 +
Nasledujúce časti popisujú ako získať FreePascal a ako správne nainštalovať Lazarus.
  
 
==Inštalácia prekladača FreePascal==
 
==Inštalácia prekladača FreePascal==
  
Rozsiahla diskusia o inštalácii a budovaní prekladačov FreePascal je dostupná na http://www.stack.nl/~marcov/buildfaq.pdf -  pre niektorých užívateľov môže byť trochu detailná, ale je dostatočne vyčerpávajúca.
+
Rozsiahla diskusia o inštalácii a budovaní prekladačov FreePascal je dostupná na http://www.stack.nl/~marcov/buildfaq.pdf -  pre niektorých užívateľov môže byť zbytočne podrobná, ale je dostatočne vyčerpávajúca.
  
 
Lazarus vyžaduje FreePascal verzie 1.9.x a vyžaduje ako preložené knižnice FreePascal (binárne súbory), tak aj zdrojové kódy rovnakej verzie. FreePascal 1.0.6 je veľmi mladý a FreePascal 1.0.10 má problémy s otváraním formulárov vytvorených pomocou FreePascal 1.9.x.
 
Lazarus vyžaduje FreePascal verzie 1.9.x a vyžaduje ako preložené knižnice FreePascal (binárne súbory), tak aj zdrojové kódy rovnakej verzie. FreePascal 1.0.6 je veľmi mladý a FreePascal 1.0.10 má problémy s otváraním formulárov vytvorených pomocou FreePascal 1.9.x.
  
===Binárne súbory FPC pre Windows===
+
===Installing Free Pascal under Linux===
 +
 
 +
====FPC Binaries====
 +
 
 +
At the lazarus downloads section (http://www.lazarus.freepascal.org) you can get the RPM of the Free Pascal compiler (compiler / linux) and its packages. If you don't have an RPM-based distribution, you can download and install the tarballs from http://www.freepascal.org. If you want to compile the binaries for yourself, see the BSD section.
 +
 
 +
Instructions:
 +
 
 +
Download lastest files from http://sourceforge.net/project/showfiles.php?group_id=89339.
 +
As example:
 +
:* fpc-1.9.5-040808.i386.rpm
 +
:* fpcsrc-1.9.5-040808.i386.rpm
 +
:* lazarus-0.9.2.1-fpc_1.9.5_040808.i386.rpm<br>
 +
and install them with:
 +
:* rpm -Uvh fpc-1.9.5-040808.i386.rpm
 +
:* rpm -Uvh fpcsrc-1.9.5-040808.i386.rpm
 +
:* rpm -Uvh lazarus-0.9.2.1-fpc_1.9.5_040808.i386.rpm
 +
 
 +
Daily snapshot Debian packages can be downloaded from http://cYcnus.de/deb/. At present this contains only the compiled fpc components, but not the sources, which would be needed for most Lazarus programming.
 +
 
 +
====FPC Sources====
 +
 
 +
The easiest way to get the freepascal sources is via cvs. You can also download it as whole; see http://www.freepascal.org/develop.html for the daily snapshot of the 1.9.x release tree.
 +
 
 +
Getting Last FPC Sources via CVS
 +
 
 +
Create a directory, where you would like to put the sources. You don't need to be root to do this. Any normal user  can do this. First create a directory for fpc (e.g. /home/username/freepascal) then do the following:
 +
[]$ bash
 +
[]$ export CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS
 +
[]$ cvs login  // password is 'cvs' without the commas.
 +
[]$ cvs -z3 co fpc  // This will create a directory called 'fpc', which can be later used in the IDE.
 +
Hint: To download/update the latest changes you can simply do
 +
[]$ cd /home/username/freepascal/fpc
 +
[]$ cvs -z3 update -dP
 +
 
 +
===Inštalácia Free Pascal vo Windows===
 +
 
 +
====Binárne súbory FPC pre Windows====
  
 
Najjednoduchším spôsobom ako získať fungujúcu inštaláciu FreePascal je stiahnuť si aktuálnu release binárnych súborov Lazarus pre Windows zo SourceForge.net – release obsahuje aktuálnu verziu prekladača FreePascal a knižnice FreePascal, ako aj Lazarus IDE. Ak však chcete inštalovať zo zdrojových súborov, čítajte ďalej!
 
Najjednoduchším spôsobom ako získať fungujúcu inštaláciu FreePascal je stiahnuť si aktuálnu release binárnych súborov Lazarus pre Windows zo SourceForge.net – release obsahuje aktuálnu verziu prekladača FreePascal a knižnice FreePascal, ako aj Lazarus IDE. Ak však chcete inštalovať zo zdrojových súborov, čítajte ďalej!
Line 31: Line 75:
 
Inštalačný zip FreePascal 1.9.3 môžete získať v časti download na FreePascal. Popis inštalácie zo zdrojových súborov je v nasledujúcej časti, ale táto inštalácia nie je vhodná pre začiatočníkov, pretože potrebujete aj počiatočný prekladač.
 
Inštalačný zip FreePascal 1.9.3 môžete získať v časti download na FreePascal. Popis inštalácie zo zdrojových súborov je v nasledujúcej časti, ale táto inštalácia nie je vhodná pre začiatočníkov, pretože potrebujete aj počiatočný prekladač.
  
===Zdrojové kódy FPC pre Windows===
+
====Zdrojové kódy FPC pre Windows====
  
 
Najjednoduchší spôsob ako získať zdrojové kódy FreePascal je pomocou CVS. Zdrojové kódy môžete tiež stiahnuť ako celý balíček – pozrite http://www.freepascal.org/develop.html, kde je strom dennej snímky release 1.9.x.
 
Najjednoduchší spôsob ako získať zdrojové kódy FreePascal je pomocou CVS. Zdrojové kódy môžete tiež stiahnuť ako celý balíček – pozrite http://www.freepascal.org/develop.html, kde je strom dennej snímky release 1.9.x.
  
====Zdrojové kódy FPC pomocou CVS====
+
Zdrojové kódy FPC pomocou CVS
  
 
Na vykonanie nasledujúcich krokov budete potrebovať klienta CVS, napr. [http://www.tortoisecvs.org/ TortoiseCVS] alebo [http://www.wincvs.org/ WinCVS]. Presné príkazy sa môžu medzi klientami meniť; nasledujúce sú pre použitie s klientom [https://ccvs.cvshome.org/files/documents/19/324/cvs-1-12-9.zip CVS home].
 
Na vykonanie nasledujúcich krokov budete potrebovať klienta CVS, napr. [http://www.tortoisecvs.org/ TortoiseCVS] alebo [http://www.wincvs.org/ WinCVS]. Presné príkazy sa môžu medzi klientami meniť; nasledujúce sú pre použitie s klientom [https://ccvs.cvshome.org/files/documents/19/324/cvs-1-12-9.zip CVS home].
  
 
Najprv si vytvorte adresár, do ktorého radi umiestnili zdrojové súbory. (napr. c:\source), potom do príkazového riadku zadajte tieto príkazy:
 
Najprv si vytvorte adresár, do ktorého radi umiestnili zdrojové súbory. (napr. c:\source), potom do príkazového riadku zadajte tieto príkazy:
 
 
   C:\Source> set CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS
 
   C:\Source> set CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS
   C:\Source> cvs login      // eslo je 'cvs' bez apostrofov
+
   C:\Source> cvs login      // heslo je 'cvs' bez apostrofov
 
   C:\source> cvs -z3 co fpc // týmto vytvoríte adresár fpc, ktorý neskôr použijete v IDE.
 
   C:\source> cvs -z3 co fpc // týmto vytvoríte adresár fpc, ktorý neskôr použijete v IDE.
Pre stiahnutie/aktualizáciu posledných zmien jednoducho zadajte:
+
Typ: Pre stiahnutie/aktualizáciu posledných zmien jednoducho zadajte:
 
   C:\> cd Source\FPC
 
   C:\> cd Source\FPC
 
   C:\Source\FPC> cvs -z3 update -dP
 
   C:\Source\FPC> cvs -z3 update -dP
 +
''ToDo: Write me.''
  
 
Pozrite si http://www.freepascal.org/down-win32.html Zoznam zrkadiel nájdete na http://www.freepascal.org/sdown.html. Stiahnute FreePascal ako jeden veľký súbor, rozbaľte ho a spusťte install.exe.
 
Pozrite si http://www.freepascal.org/down-win32.html Zoznam zrkadiel nájdete na http://www.freepascal.org/sdown.html. Stiahnute FreePascal ako jeden veľký súbor, rozbaľte ho a spusťte install.exe.
  
Do systémovej premennej PATH pridajte adresár  
+
Do systémovej premennej PATH pridajte adresár fpc:
 
* Win98: Upravte autoexec.bat pridaním riadku: PATH=%PATH%;C:\pp\bin\bin\win32
 
* Win98: Upravte autoexec.bat pridaním riadku: PATH=%PATH%;C:\pp\bin\bin\win32
 
* WinXP/2k: Tento počítač (pravý klik) ->  Vlastnosti -> Spresnenie (stránka) -> Premenné prostredia -> Systémové premenné -> Upravte "PATH" pridaním "C:\pp\bin\bin\win32".
 
* WinXP/2k: Tento počítač (pravý klik) ->  Vlastnosti -> Spresnenie (stránka) -> Premenné prostredia -> Systémové premenné -> Upravte "PATH" pridaním "C:\pp\bin\bin\win32".
  
 
Potom reštartujte Windows.
 
Potom reštartujte Windows.
 +
 +
''ToDo: Explain how to download fpc sources and build the compiler''
 +
 +
===Installing Free Pascal under BSD/manually===
 +
 +
Effectively, you need
 +
 +
A file with all sources, or two (fpc and lazarus)
 +
 +
1. e.g. for fpc ftp://ftp.freepascal.org/fpc/dist/Linux/separate/sources.tar preferably an export (no CVS/ dirs). The above file misses this.
 +
2. Lazarus source snapshot.
 +
* _any_ starting compiler from the 1.9 branch) You can do a check by parsing the output of ppc386 -i if it is 1.9.3 .. 2.0.x it is ok.
 +
* - dependant packages. (for FreeBSD that is gtk12, glib12 and gdk_pixbuf and GNU make, iconv and gettext)
 +
 +
FPC build:
 +
 +
1. (fetch) necessary files (FPC source, starting compiler)
 +
2. (extract) Then de-tgz in work directory,
 +
3. (build) enter work/fpc/ and run
 +
 +
  $MAKE all OPT='-gl -O3p3'  PP=/path/to/startingcompiler-name-ppc386
 +
(/path/to/ can be omitted when ppc386 is in the path)
 +
($MAKE is make on linux and gmake on BSD)
 +
 +
4. (install) then, again in work/fpc, run
 +
 +
$MAKE install PP=compiler/ppc386 PREFIX=$THEPREFIX
 +
(THEPREFIX= usually is /usr/lcoal, but e.g. on NetBSD it is /usr/pkg for ports)
 +
Create a symlink:
 +
  ln -s $THEPREFIX/lib/fpc/1.0.8/ppc386 $THEPREFIX/bin/ppc386
 +
      install sourceinstall PREFIX=$THEPREFIX
 +
 +
5. (configure) run compiler/utils/samplecfg $THEPREFIX/lib/fpc/1.9.3 $ETCDIR
 +
6. (optional, test), see if ppc386 -i gives output, else give a warning that user need to add $PREFIX/bin to his current path. Try to compiler a program with -viwn, and see if that gives errors.
 +
Notes:
 +
 +
* If you need fpcmake package lists, you need to generate or supply them yourself, (in the port, or in an extra archive) either way, do a dummy install to /tmp/pack and determine the files installed with find . >ll
 +
 +
* $THEPREFIX and $ETCDIR should be user configurable. Otherwise local installs aren't possible.
 +
 +
* BSDHIER=1 on all make commands forces BSD hierarchy conventions.
 +
 +
===Installing Free Pascal under Mac OS X===
 +
 +
You need the Apple Developer-tools, X11, gtk1.2:
 +
 +
Downloading packages and installing them properly can be a time consuming task. Therefore there are various package managers. One of them is fink:
 +
: Download fink from http://fink.sourceforge.net/download/index.php?phpLang=en; follow the install instructions.
 +
 +
Developer-tools: Are included on the original OSX installation-CDs, or download at ADC (free registration required)
 +
: http://developer.apple.com/.
 +
 +
Apple X11: On a fresh system: choose "Customize" in the install-dialogue, check "X11".
 +
 +
On an already installed system: download at
 +
: http://www.apple.com/downloads/macosx/apple/x11formacosx.html
 +
 +
In the Terminal, run
 +
        sudo fink install gtk-pixbuf gtk+ gtk+-data gtk+-shlibs gtk-doc 1.2-13 gtkglarea gtk-engines
 +
The X11-Application is in /Applications/Utilities/X11.
 +
 +
Hint: Most X11 programs, including lazarus expect to receive focus, when the users clicks on a window. Under MacOSX this is deactivated. You can activate it for all X11 applications by typing in the terminal:
 +
        defaults write com.apple.x11 wm_click_through -bool true
 +
 +
;Free Pascal Compiler:
 +
Then download and install the Free Pascal Compiler (at least 1.9.5 from 16th Aughust 2004) from
 +
: https://sourceforge.net/project/showfiles.php?group_id=89339
 +
 +
For lazarus you need the fpc sources as well:
 +
Create a directory, where you would like to put the sources. You don't need to be root to do this. Any normal user can do this.
 +
First create a directory for fpc
 +
: (e.g. /Users/username/freepascal)
 +
then open a terminal and do the following:
 +
[]$ bash
 +
[]$ export CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS
 +
[]$ cvs login
 +
password is 'cvs' without the 'quotes'
 +
[]$ cvs -z3 co fpc
 +
This will create a directory called 'fpc', which can be later used in the IDE.
 +
Hint: To download/update the latest changes you can simply do
 +
[]$ cd /Users/username/freepascal/fpc
 +
[]$ cvs -z3 update -dP
  
 
==Inštalácia Lazarus==
 
==Inštalácia Lazarus==
  
===Binárne súbory Lazarus===
+
===Installing Lazarus under Linux===
 +
 
 +
The easiest way to get a current working installation of Lazarus is to download the RPMs for FreePascal and Lazarus from the SourceForge repository.
 +
 
 +
You need to download the selected version of
 +
* the compiler (eg fpc-1.9.5-041207.i386.rpm)
 +
* the pascal source library (eg fpcsrc-1.9.5-041207.i386.rpm)
 +
* the Lazarus package (eg lazarus-0.9.2.4-fpc_1.9.5_041207.i386.rpm).
 +
 
 +
You then issue the following commands (you need to have root privileges - use su or sudo)
 +
rpm -Uvh fpc-1.9.5-041207.i386.rpm
 +
rpm -Uvh fpcsrc-1.9.5-041207.i386.rpm
 +
rpm -Uvh lazarus-0.9.2.4-fpc_1.9.5_041207.i386.rpm
 +
 
 +
If you prefer to install from source and compile the files yourself, follow these instructions. Because the whole lazarus stuff is installed into one directory, uninstall is very easy and you don't need to be root to install lazarus. You can get tgz files for fpc, fpcsrc and lazarus from the downloads section or you can download it directly via cvs.
 +
 
 +
;Downloading lazarus cvs:
 +
cvs provides an easy way to update your sources by only downloading the changes. This is the recommended way and saves you a lot of time. A connection to the internet is needed for this: You don't to be root. Lazarus does not need any special permissions, neither during installation nor at runtime. First create a directory for lazarus (e.g. /home/username/freepascal) then do the following:
 +
 
 +
;connect to the cvs server (note: lazarus and freepascal use the same server)
 +
[]$ export CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS
 +
[]$ cvs login
 +
password is 'cvs' without the ''.
 +
 
 +
;download the lazarus sources:
 +
[]$ cvs -z3 co lazarus
 +
compile lazarus:
 +
[]$ cd lazarus
 +
[]$ make  (gmake on BSD)
 +
 
 +
If fpc is installed correctly, the compilation should work without problems. If not, see FAQ.
 +
 
 +
;Start lazarus
 +
[]$ ./lazarus
 +
 
 +
The IDE should start. If you started lazarus in a terminal, you can see some notes about missing settings. This is normal at first start. The IDE automatically tries to find out where the freepascal compiler and its sources are installed by searching in the most common directories.
 +
 
 +
;Check the paths:
 +
: Use the IDE menu to go to
 +
:: Environment -> Environment Options -> Files
 +
 
 +
The 'FPC Source directory' should point to your fpc source directory. This directory normally ends with /fpc/ or /fpcsrc/ (e.g. /usr/src/fpcsrc or /home/username/freepascal/fpc) and contains directories like 'compiler', 'docs', 'fcl', 'rtl' and 'packages'.
 +
 +
''ToDo: explain the other paths''
 +
 
 +
;Hint:
 +
To update lazarus you can use
 +
[]$ cd /home/username/freepascal/lazarus
 +
[]$ cvs -z3 update -dP
 +
[]$ make clean all  (gmake on BSD)
 +
This will rebuild lazarus and create an IDE without lazarus packages. To link your installed packages do '''after''' the above:
 +
[]$ make idepkg
 +
 
 +
====Installing Lazarus under Debian GNU/Linux====
 +
 
 +
There are preliminary Debian packages for lazarus available for download. Make sure you read /usr/share/doc/lazarus/README.Debian carefully before you start using it. Feedback is needed and appreciated; please send your comments to Carlos Laviola <claviola@debian.org>.
 +
 
 +
====Another (?easier) 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-1.9.5-041001.i386.rpm
 +
* fpcsrc-1.9.5-041001.i386.rpm
 +
* lazarus-0.9.2.2-fpc_1.9.5_041001.i386.rpm
 +
cd to the directory where these files are stored, then become root (su) and type:
 +
 
 +
alien fpc*    //this will convert both the fpc and fpcsrc files to debian format
 +
alien laz*
 +
then use kpackage or a similar utility to install the fpc, fpcsrc and lazarus **.rpm.deb files.
 +
 
 +
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/1.9.5 and then type
 +
sh ./samplecfg /usr/lib/fpc/1.9.5 /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.
  
Aktuálna release binárnych balíčkov Lazarus pre Windows sa inštaluje veľmi jednoducho. Binárny balíček je dostupný z [http://sourceforge.net/project/showfiles.php?group_id=89339 SourceForge.net]
+
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!
  
Stiahnite poslednú release a spusťte aplikáciu. Dostanete sa do typickej inštalácie Windows, v ktorej sú prekladač FreePascal a zdrojové knižnice nainštalované do rovnakej adresárovej štruktúry ako Lazarus a môžete spustiť IDE a pracovať bez väčších problémov, za predpokladu, že máte odinštalovanú predchádzajúcu verziu Lazarus a/alebo FreePascal (často v adresári C:\pp).
+
===Installing Lazarus under Mac OS X===
 +
 
 +
Works pretty much the same as under Linux. But you need to install first the apple developer tools and X11:
 +
 
 +
===Inštalácia Lazarus vo Windows===
 +
 
 +
Aktuálna release binárnych balíčkov Lazarus pre Windows sa inštaluje veľmi jednoducho. Binárny balíček pre Linux i Windows je dostupný z [http://sourceforge.net/project/showfiles.php?group_id=89339 SourceForge.net]
 +
 
 +
Stiahnite poslednú verziu (momentálne (currently Lazarus-0.9.2.4-20041210-win32.exe) a spusťte aplikáciu. Dostanete sa do typickej inštalácie Windows, v ktorej sú prekladač FreePascal a zdrojové knižnice nainštalované do rovnakej adresárovej štruktúry ako Lazarus a môžete spustiť IDE a pracovať bez väčších problémov, za predpokladu, že máte odinštalovanú predchádzajúcu verziu Lazarus a/alebo FreePascal (väčšinou v adresári C:\pp).
  
 
Lazarus Snapshot pre Windows nájdete aj na: http://www.ca.freepascal.org/Lazarus/
 
Lazarus Snapshot pre Windows nájdete aj na: http://www.ca.freepascal.org/Lazarus/
  
===Zdrojové súbory Lazarus===
+
====Inštalácia so zdrojových súborov====
 +
 
 
Ak dávate prednosť inštalácii zo zdrojových kódov, postupujte podľa nasledujúcich inštrukcií
 
Ak dávate prednosť inštalácii zo zdrojových kódov, postupujte podľa nasledujúcich inštrukcií
* stiahnite zdrojové kódy Lazarus z ftp://ftp.freepascal.org/pub/fpc/snapshot/lazarus/lazarus.zip
+
(Vďaka, Joe, za tento popis Krok za krokom)
* rozbaľte archív, napr. do c:\Lazarus.
 
* potrebujete mať nainštalovaný aspoň FreePascal-1.9.3, ktorým preložíte zdrojové kódy a Lazarus.exe pracuje.
 
* cesta k môjmu (pôv. autorora) FreePascal je c:\pp\bin\win32. V tomto adresári nájdete viacero spustiteľných súborov (make, grep, ppc386 atď.).
 
* otvorte konzolu (príkazový riadok) a zadajte:
 
  
 +
* potrebujete stiahnuť zdrojové kódy Lazarus z ftp://ftp.freepascal.org/pub/fpc/snapshot/lazarus/lazarus.zip
 +
 +
''ToDo: pôvodná adresa ftp://ftp.freepascal.org/pub/fpc/source/lazarus.zip nefunguje, ale neviem či ide o to isté...''
 +
 +
* archív rozbaľte, napr. do c:\Lazarus. Potrebujete mať nainštalovaný aspoň FreePascal-1.9.3, ktorým preložíte zdrojové kódy a Lazarus.exe pracuje. Cesta k môjmu (pôv. autorora) FreePascal je c:\pp\bin\win32. V tomto adresári nájdete viacero spustiteľných súborov (make, grep, ppc386 atď.).
 +
 +
* Otvorte konzolu (príkazový riadok) a zadajte:
 
  cd c:\lazarus
 
  cd c:\lazarus
  set path=c:\pp\bin\win32;c:\lazarus  //of course change the first to
+
  set path=c:\pp\bin\win32;c:\lazarus  //samozrejme zmeňte na svoju cestu
                                      //the path of yours
 
 
  windres -i lazarus.rc -o lazarus.res
 
  windres -i lazarus.rc -o lazarus.res
 
  make
 
  make
Line 83: Line 300:
  
 
Môžete tiež preložiť príklady:
 
Môžete tiež preložiť príklady:
 
 
  cd examples
 
  cd examples
 
  make
 
  make
Line 89: Line 305:
 
Ak rozbalíte Lazarus na iný disk, napr.: d:\Lazarus. Môže sa stať, že budete potrebovať utilitu gnu na jeho vytvorenie, ak ju máte, zadajte jej cestu do premennej Path, ale jednoduchšie je nevyberať iný disk.
 
Ak rozbalíte Lazarus na iný disk, napr.: d:\Lazarus. Môže sa stať, že budete potrebovať utilitu gnu na jeho vytvorenie, ak ju máte, zadajte jej cestu do premennej Path, ale jednoduchšie je nevyberať iný disk.
  
 +
To je všetko.
 +
 +
=== Additional experiences and advice on installing FPC and Lazarus ===
 +
On linux, getting Lazarus to work can be complicated. 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 (eg /usr/local/bin/ppc386), the FreePascal source directory (eg /usr/local/lib/fpc/$version/fpc or a directory in your own space eg ~/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.
  
 +
===Installing Lazarus under BSD===
  
==Spolupracovníci a zmeny==
+
  Please write me!
  
* - Stránka je preložená a skrátená z anglického originálu [[Installing Lazarus]] [[User:Slavko|Slavko]] 04:22, 20 Mar 2005 (PST)
+
==Pôvodní spolupracovníci a zmeny==
 +
This page has been converted from the epikwiki [http://lazarus-ccr.sourceforge.net/index.php?wiki=InstallingLazarus version].
 +
* Initially imported and formatted. [[User:Tom | VlxAdmin]] 9/22/2003
 +
* Changed Joe's part for Windows to require fpc 1.0.10. [[User:Vincent | Vincent]] 9/25/2003
 +
* Updated "What is required for lazarus". AndrewJohnson 10/1/2003
 +
* Finished formatted the InstallingLazarus page [[User:Tom | 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. [[User:Tom | VlxAdmin]]
 +
* Corrected a couple of typos - 3/12/2004 [[User:Kirkpatc]]
 +
* Added link for daily snapshot deb packages - 3/27/2004 [[User:Vincent | 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]]

Revision as of 23:23, 20 March 2005

Úvod

Pre tých, ktorí jednoducho chcú nainštalovať Lazarus a začať ho používať pre programovanie, je najjednoduchším prístupom stiahnuť a nainštalovať najnovšiu, podľa možností stabilnú, binárnu verziu (linuxový balíček ".rpm alebo windowsový balíček ".exe"). Môžete si prečíteť časti pod Linux alebo Windows nazvané "fpc binaries" alebo prvé odstavece v časti o inštalácii Lazarus v Linuxe alebo vo Windows; väčšinu ostatných informácií môžete kľudne ignorovať.

Tí, ktorí sa chcú spolupracovať pri vývoji prekladača alebo IDE, alebo chcú mať najaktuálnejšie nástroje, budú potrebovať inštaláciu zo zdrojových súborov a väčšina zvyšných informácií je pre nich relevantná.

Lazarus pozostáva z dvoch základných častí:

  • LCL - knižnica komponentov Lazarus (Lazarus Component Library)
  • IDE - Integrované vývojové prostredie

Tieto v podstate závisia na:

  • FreePascal – prekladač FreePascal
  • FCL – knižnica komponentov FreePascal (FreePascal Component library,obsahujúca väčšinu nevizuálnych komponentov použitých v Lazarus

Systémové požiadavky Lazarus

  1. prekladač FreePascal, balíčky a zdrojové kódy (*dôležité* rovnakej verzie/dátumu)
  2. podporovaný Widget tool-kit
    Win32
    : môže byť použité pôvodné Win32 API
    Linux/xxxBSD
    GTK+ 1.2.x : Most Linux distributions and *BSDs already install the GTK+ 1.2.x libraries. You can also find them at http://www.gtk.org.
    You'll also want gdk-pixbuf, 0.13 or newer (preferably 0.18 or newer), which is also found in most recent distributions from the past 2 years. The source is available from ftp://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/
    Mac OS X
    GTK+ 1.2.x : You need the apple developer tools, X11 and GTK1.2. See below Installing under Mac OS X.
    GTK+ 2.x
    WARNING : The GTK2 interface is not yet complete and is only for testing purposes.
    It's found in most recent distributions. For the source see http://www.gtk.org.

FAQ - Najčastejšiekladené otázky sú dostupné na http://www.lazarus.freepascal.org . Niektoré z otázok môžete nájsť v lokálnom súbore 'FAQ'.

Nasledujúce časti popisujú ako získať FreePascal a ako správne nainštalovať Lazarus.

Inštalácia prekladača FreePascal

Rozsiahla diskusia o inštalácii a budovaní prekladačov FreePascal je dostupná na http://www.stack.nl/~marcov/buildfaq.pdf - pre niektorých užívateľov môže byť zbytočne podrobná, ale je dostatočne vyčerpávajúca.

Lazarus vyžaduje FreePascal verzie 1.9.x a vyžaduje ako preložené knižnice FreePascal (binárne súbory), tak aj zdrojové kódy rovnakej verzie. FreePascal 1.0.6 je veľmi mladý a FreePascal 1.0.10 má problémy s otváraním formulárov vytvorených pomocou FreePascal 1.9.x.

Installing Free Pascal under Linux

FPC Binaries

At the lazarus downloads section (http://www.lazarus.freepascal.org) you can get the RPM of the Free Pascal compiler (compiler / linux) and its packages. If you don't have an RPM-based distribution, you can download and install the tarballs from http://www.freepascal.org. If you want to compile the binaries for yourself, see the BSD section.

Instructions:

Download lastest files from http://sourceforge.net/project/showfiles.php?group_id=89339. As example:

  • fpc-1.9.5-040808.i386.rpm
  • fpcsrc-1.9.5-040808.i386.rpm
  • lazarus-0.9.2.1-fpc_1.9.5_040808.i386.rpm

and install them with:

  • rpm -Uvh fpc-1.9.5-040808.i386.rpm
  • rpm -Uvh fpcsrc-1.9.5-040808.i386.rpm
  • rpm -Uvh lazarus-0.9.2.1-fpc_1.9.5_040808.i386.rpm

Daily snapshot Debian packages can be downloaded from http://cYcnus.de/deb/. At present this contains only the compiled fpc components, but not the sources, which would be needed for most Lazarus programming.

FPC Sources

The easiest way to get the freepascal sources is via cvs. You can also download it as whole; see http://www.freepascal.org/develop.html for the daily snapshot of the 1.9.x release tree.

Getting Last FPC Sources via CVS

Create a directory, where you would like to put the sources. You don't need to be root to do this. Any normal user can do this. First create a directory for fpc (e.g. /home/username/freepascal) then do the following:

[]$ bash
[]$ export CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS
[]$ cvs login   // password is 'cvs' without the commas.
[]$ cvs -z3 co fpc   // This will create a directory called 'fpc', which can be later used in the IDE.

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

[]$ cd /home/username/freepascal/fpc
[]$ cvs -z3 update -dP

Inštalácia Free Pascal vo Windows

Binárne súbory FPC pre Windows

Najjednoduchším spôsobom ako získať fungujúcu inštaláciu FreePascal je stiahnuť si aktuálnu release binárnych súborov Lazarus pre Windows zo SourceForge.net – release obsahuje aktuálnu verziu prekladača FreePascal a knižnice FreePascal, ako aj Lazarus IDE. Ak však chcete inštalovať zo zdrojových súborov, čítajte ďalej!

Inštalačný zip FreePascal 1.9.3 môžete získať v časti download na FreePascal. Popis inštalácie zo zdrojových súborov je v nasledujúcej časti, ale táto inštalácia nie je vhodná pre začiatočníkov, pretože potrebujete aj počiatočný prekladač.

Zdrojové kódy FPC pre Windows

Najjednoduchší spôsob ako získať zdrojové kódy FreePascal je pomocou CVS. Zdrojové kódy môžete tiež stiahnuť ako celý balíček – pozrite http://www.freepascal.org/develop.html, kde je strom dennej snímky release 1.9.x.

Zdrojové kódy FPC pomocou CVS

Na vykonanie nasledujúcich krokov budete potrebovať klienta CVS, napr. TortoiseCVS alebo WinCVS. Presné príkazy sa môžu medzi klientami meniť; nasledujúce sú pre použitie s klientom CVS home.

Najprv si vytvorte adresár, do ktorého radi umiestnili zdrojové súbory. (napr. c:\source), potom do príkazového riadku zadajte tieto príkazy:

 C:\Source> set CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS
 C:\Source> cvs login      // heslo je 'cvs' bez apostrofov
 C:\source> cvs -z3 co fpc // týmto vytvoríte adresár fpc, ktorý neskôr použijete v IDE.

Typ: Pre stiahnutie/aktualizáciu posledných zmien jednoducho zadajte:

 C:\> cd Source\FPC
 C:\Source\FPC> cvs -z3 update -dP

ToDo: Write me.

Pozrite si http://www.freepascal.org/down-win32.html Zoznam zrkadiel nájdete na http://www.freepascal.org/sdown.html. Stiahnute FreePascal ako jeden veľký súbor, rozbaľte ho a spusťte install.exe.

Do systémovej premennej PATH pridajte adresár fpc:

  • Win98: Upravte autoexec.bat pridaním riadku: PATH=%PATH%;C:\pp\bin\bin\win32
  • WinXP/2k: Tento počítač (pravý klik) -> Vlastnosti -> Spresnenie (stránka) -> Premenné prostredia -> Systémové premenné -> Upravte "PATH" pridaním "C:\pp\bin\bin\win32".

Potom reštartujte Windows.

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

Installing Free Pascal under BSD/manually

Effectively, you need

A file with all sources, or two (fpc and lazarus)

1. e.g. for fpc ftp://ftp.freepascal.org/fpc/dist/Linux/separate/sources.tar preferably an export (no CVS/ dirs). The above file misses this. 2. Lazarus source snapshot.

  • _any_ starting compiler from the 1.9 branch) You can do a check by parsing the output of ppc386 -i if it is 1.9.3 .. 2.0.x it is ok.
  • - dependant packages. (for FreeBSD that is gtk12, glib12 and gdk_pixbuf and GNU make, iconv and gettext)

FPC build:

1. (fetch) necessary files (FPC source, starting compiler) 2. (extract) Then de-tgz in work directory, 3. (build) enter work/fpc/ and run

 $MAKE all OPT='-gl -O3p3'  PP=/path/to/startingcompiler-name-ppc386
(/path/to/ can be omitted when ppc386 is in the path)
($MAKE is make on linux and gmake on BSD)

4. (install) then, again in work/fpc, run

$MAKE install PP=compiler/ppc386 PREFIX=$THEPREFIX
(THEPREFIX= usually is /usr/lcoal, but e.g. on NetBSD it is /usr/pkg for ports)
Create a symlink:
  ln -s $THEPREFIX/lib/fpc/1.0.8/ppc386 $THEPREFIX/bin/ppc386
     install sourceinstall PREFIX=$THEPREFIX

5. (configure) run compiler/utils/samplecfg $THEPREFIX/lib/fpc/1.9.3 $ETCDIR 6. (optional, test), see if ppc386 -i gives output, else give a warning that user need to add $PREFIX/bin to his current path. Try to compiler a program with -viwn, and see if that gives errors. Notes:

  • If you need fpcmake package lists, you need to generate or supply them yourself, (in the port, or in an extra archive) either way, do a dummy install to /tmp/pack and determine the files installed with find . >ll
  • $THEPREFIX and $ETCDIR should be user configurable. Otherwise local installs aren't possible.
  • BSDHIER=1 on all make commands forces BSD hierarchy conventions.

Installing Free Pascal under Mac OS X

You need the Apple Developer-tools, X11, gtk1.2:

Downloading packages and installing them properly can be a time consuming task. Therefore there are various package managers. One of them is fink:

Download fink from http://fink.sourceforge.net/download/index.php?phpLang=en; follow the install instructions.

Developer-tools: Are included on the original OSX installation-CDs, or download at ADC (free registration required)

http://developer.apple.com/.

Apple X11: On a fresh system: choose "Customize" in the install-dialogue, check "X11".

On an already installed system: download at

http://www.apple.com/downloads/macosx/apple/x11formacosx.html

In the Terminal, run

       sudo fink install gtk-pixbuf gtk+ gtk+-data gtk+-shlibs gtk-doc 1.2-13 gtkglarea gtk-engines

The X11-Application is in /Applications/Utilities/X11.

Hint: Most X11 programs, including lazarus expect to receive focus, when the users clicks on a window. Under MacOSX this is deactivated. You can activate it for all X11 applications by typing in the terminal:

       defaults write com.apple.x11 wm_click_through -bool true
Free Pascal Compiler

Then download and install the Free Pascal Compiler (at least 1.9.5 from 16th Aughust 2004) from

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

For lazarus you need the fpc sources as well: Create a directory, where you would like to put the sources. You don't need to be root to do this. Any normal user can do this. First create a directory for fpc

(e.g. /Users/username/freepascal)

then open a terminal and do the following:

[]$ bash
[]$ export CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS
[]$ cvs login

password is 'cvs' without the 'quotes'

[]$ cvs -z3 co fpc

This will create a directory called 'fpc', which can be later used in the IDE. Hint: To download/update the latest changes you can simply do

[]$ cd /Users/username/freepascal/fpc
[]$ cvs -z3 update -dP

Inštalácia Lazarus

Installing Lazarus under Linux

The easiest way to get a current working installation of Lazarus is to download the RPMs for FreePascal and Lazarus from the SourceForge repository.

You need to download the selected version of

  • the compiler (eg fpc-1.9.5-041207.i386.rpm)
  • the pascal source library (eg fpcsrc-1.9.5-041207.i386.rpm)
  • the Lazarus package (eg lazarus-0.9.2.4-fpc_1.9.5_041207.i386.rpm).

You then issue the following commands (you need to have root privileges - use su or sudo)

rpm -Uvh fpc-1.9.5-041207.i386.rpm
rpm -Uvh fpcsrc-1.9.5-041207.i386.rpm
rpm -Uvh lazarus-0.9.2.4-fpc_1.9.5_041207.i386.rpm

If you prefer to install from source and compile the files yourself, follow these instructions. Because the whole lazarus stuff is installed into one directory, uninstall is very easy and you don't need to be root to install lazarus. You can get tgz files for fpc, fpcsrc and lazarus from the downloads section or you can download it directly via cvs.

Downloading lazarus cvs

cvs provides an easy way to update your sources by only downloading the changes. This is the recommended way and saves you a lot of time. A connection to the internet is needed for this: You don't to be root. Lazarus does not need any special permissions, neither during installation nor at runtime. First create a directory for lazarus (e.g. /home/username/freepascal) then do the following:

connect to the cvs server (note
lazarus and freepascal use the same server)
[]$ export CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS
[]$ cvs login

password is 'cvs' without the .

download the lazarus sources
[]$ cvs -z3 co lazarus

compile lazarus:

[]$ cd lazarus
[]$ make  (gmake on BSD)

If fpc is installed correctly, the compilation should work without problems. If not, see FAQ.

Start lazarus
[]$ ./lazarus

The IDE should start. If you started lazarus in a terminal, you can see some notes about missing settings. This is normal at first start. The IDE automatically tries to find out where the freepascal compiler and its sources are installed by searching in the most common directories.

Check the paths
Use the IDE menu to go to
Environment -> Environment Options -> Files

The 'FPC Source directory' should point to your fpc source directory. This directory normally ends with /fpc/ or /fpcsrc/ (e.g. /usr/src/fpcsrc or /home/username/freepascal/fpc) and contains directories like 'compiler', 'docs', 'fcl', 'rtl' and 'packages'.

ToDo: explain the other paths

Hint

To update lazarus you can use

[]$ cd /home/username/freepascal/lazarus
[]$ cvs -z3 update -dP
[]$ make clean all   (gmake on BSD)

This will rebuild lazarus and create an IDE without lazarus packages. To link your installed packages do after the above:

[]$ make idepkg

Installing Lazarus under Debian GNU/Linux

There are preliminary Debian packages for lazarus available for download. Make sure you read /usr/share/doc/lazarus/README.Debian carefully before you start using it. Feedback is needed and appreciated; please send your comments to Carlos Laviola <claviola@debian.org>.

Another (?easier) 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-1.9.5-041001.i386.rpm
  • fpcsrc-1.9.5-041001.i386.rpm
  • lazarus-0.9.2.2-fpc_1.9.5_041001.i386.rpm

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

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

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

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/1.9.5 and then type

sh ./samplecfg /usr/lib/fpc/1.9.5 /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.

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 Lazarus under Mac OS X

Works pretty much the same as under Linux. But you need to install first the apple developer tools and X11:

Inštalácia Lazarus vo Windows

Aktuálna release binárnych balíčkov Lazarus pre Windows sa inštaluje veľmi jednoducho. Binárny balíček pre Linux i Windows je dostupný z SourceForge.net

Stiahnite poslednú verziu (momentálne (currently Lazarus-0.9.2.4-20041210-win32.exe) a spusťte aplikáciu. Dostanete sa do typickej inštalácie Windows, v ktorej sú prekladač FreePascal a zdrojové knižnice nainštalované do rovnakej adresárovej štruktúry ako Lazarus a môžete spustiť IDE a pracovať bez väčších problémov, za predpokladu, že máte odinštalovanú predchádzajúcu verziu Lazarus a/alebo FreePascal (väčšinou v adresári C:\pp).

Lazarus Snapshot pre Windows nájdete aj na: http://www.ca.freepascal.org/Lazarus/

Inštalácia so zdrojových súborov

Ak dávate prednosť inštalácii zo zdrojových kódov, postupujte podľa nasledujúcich inštrukcií (Vďaka, Joe, za tento popis Krok za krokom)

ToDo: pôvodná adresa ftp://ftp.freepascal.org/pub/fpc/source/lazarus.zip nefunguje, ale neviem či ide o to isté...

  • archív rozbaľte, napr. do c:\Lazarus. Potrebujete mať nainštalovaný aspoň FreePascal-1.9.3, ktorým preložíte zdrojové kódy a Lazarus.exe pracuje. Cesta k môjmu (pôv. autorora) FreePascal je c:\pp\bin\win32. V tomto adresári nájdete viacero spustiteľných súborov (make, grep, ppc386 atď.).
  • Otvorte konzolu (príkazový riadok) a zadajte:
cd c:\lazarus
set path=c:\pp\bin\win32;c:\lazarus  //samozrejme zmeňte na svoju cestu
windres -i lazarus.rc -o lazarus.res
make

Ak všetko prebehne ako má, napíšte Lazarus.exe. Editor zdrojového kódu, dialógy a editor vlastností pracuje, ale nie perfektne... Pozrite sa a uvidíte.

Môžete tiež preložiť príklady:

cd examples
make

Ak rozbalíte Lazarus na iný disk, napr.: d:\Lazarus. Môže sa stať, že budete potrebovať utilitu gnu na jeho vytvorenie, ak ju máte, zadajte jej cestu do premennej Path, ale jednoduchšie je nevyberať iný disk.

To je všetko.

Additional experiences and advice on installing FPC and Lazarus

On linux, getting Lazarus to work can be complicated. 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 (eg /usr/local/bin/ppc386), the FreePascal source directory (eg /usr/local/lib/fpc/$version/fpc or a directory in your own space eg ~/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.

Installing Lazarus under BSD

 Please write me!

Pôvodní spolupracovníci a zmeny

This page has been converted from the epikwiki version.

  • 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