Difference between revisions of "Installing Lazarus/hu"

From Lazarus wiki
Jump to navigationJump to search
Line 310: Line 310:
 
8/ Sok sikert az ingyenes világ legkirályabb gyors alkalmazásfejlesztőjéhez!
 
8/ Sok sikert az ingyenes világ legkirályabb gyors alkalmazásfejlesztőjéhez!
  
===== Lazarus 0.9.26 on Mandriva 2007 (2007.0) (i386) (GTK-1)=====
+
===== Lazarus 0.9.26 Mandriva 2007-en (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!):
+
A telepítés Mandrivá-n nagyon egyszerű. Ellenben, van néhány pont, amit ellenőrizni kell a telepítés során. Itt egy tipikus telepítés a .tar modulok használatával (nézd meg a témákkal kapcsolatos trükköt a művelet végén!):
  
- 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.
+
- A Mandriva telepítése közben válaszd ki a "Gnome asztal" csoportot. Ha KDE-ben vagy más ablakkezelőben fogod használni a Lazarust, akkor is fontos ez, mivel néhány szükséges GTK modult fog telepíteni.
  
- Install the FPC 2.2.2 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.
+
- Telepítsd az FPC 2.2.2-es fordítót vagy .rpm vagy .tar használatával. A .tart modulok esetén ezt a parancsot kell kiadni: "sh install.sh", aztán sokszor enter-t nyomni. Én superuser módban szoktam csinálni.
  
- Install the compiler source code. just untar the file "fpc-src-2.2.4.source.tgz" in the folder /usr/local/src/fpc/ then rename the  created folder "fpc" to "2.2.2" . When complete, you have the folder /usr/local/src/fpc/2.2.2/ 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:
+
- Telepítsd a fordító forráskódját. Csak tar-old ki az "fpc-src-2.2.4.source.tgz" fájlt a /usr/local/src/fpc/ mappába, és nevezd át a létrehozott "fpc" mappát "2.2.2"-re. Ha kész van, van egy /usr/local/src/fpc/2.2.2/ mappád, ami tartalmazza a teljes forráskódot. A forráskód csak a Lazarus szerkesztőhöz szükséges, de akár újrafordíthatod belőle az FPC-t, hogy optimalizált könyvtáraid legyenek.
  
- If you want to compile FPC (optional), then go to the FPC source directory (/usr/local/src/fpc/2.2.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.  
+
- Ha le akarod fordítani az FPC-t (opcionális), akkor menj az FPC forrásmappába (/usr/local/src/fpc/2.2.4/) és írd be: "./configure", "make clean", "make all", "make install", "make clean". És az FPC telepítve van. Ellenőrizd az "/etc/fpc.cfg" tartalmát. Ezt a fájlt módosítani kell, ha a make hibára leáll.  
  
- Lazarus can be installed in user mode: just unzip/untar the file "lazarus-0.9.26.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 library files:
+
- A Lazarus felhasználói módban is telepíthető: csak zip-eld/tar-old ki a "lazarus-0.9.26.0.tar.gz" fájlt a saját mappádba. Azután csak írd be: "make clean all" felhasználói módban. A folyamat utolsó fázisa (összefűzés) általában sikertelen a hiányzó könyvtár fájlok miatt:
 
    
 
    
- Check in the directory /usr/lib/ for the following symbolic links:
+
- Ellenőrizd a /usr/lib/ mappában, hogy léteznek-e a következő szimbolikus linkek:
  
 
libglib.so -> libglib-1.2.so.0
 
libglib.so -> libglib-1.2.so.0
Line 334: Line 334:
 
libgdk_pixbuf.so -> libgdk_pixbuf.so.2.0.0
 
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!).  
+
A "libgdk_pixbuf.so.2.0.0" fájl a "libgdk_pixbuf-2.0.22.0-10mdv2007.0.rpm" modulban van. Ez a fájl név kritikus. Különösképpen a "libgdk_pixbuf-2.0.so.0"-t NE használd (félrevezető, ugye?).  
  
After all the links have been fixed, the "Linking ../lazarus" stage will not crash any more and the "./lazarus" command should start the program!
+
Minden link javítása után, a "Linking ../lazarus" lépés nem fog többé összeomlani és a "./lazarus" parancs indítja a programot!
  
- Go to the "environment/environment options" menu and change the "FPC source directory" to /user/local/src/fpc/2.2.4  
+
- Menj a Környezet -> Környezet beállításai menübe és változtasd meg az "FPC forrás mappáját" /user/local/src/fpc/2.2.4 -re
  
USEFUL TO KNOW:
+
JÓ TUDNI:
  
- The last step is to fix the theme. The package "galaxy-gnome-1.0.4-3mdv2007.0" is available in the
+
- Az utolsó lépés a téma megjavítása. A "galaxy-gnome-1.0.4-3mdv2007.0" csomag elérhető a Mandriva vezérlő központból. Telepítsd fel.  
Mandriva control center. Install it.  
 
  
- The package "gtk-theme-switch-1.0.1-4mdv2007.0.i586.rpm" is
+
- A "gtk-theme-switch-1.0.1-4mdv2007.0.i586.rpm" elérhető a weben! (furcsa módon nem jelenik meg a vezérlőközpontban)
available on the web! (strangely it did not show in the control center)
+
Telepítsd kézzel az "rpm -iv --test gtk-theme-switch-1.0.1-4mdv2007.0.i586.rpm" paranccsal, aztán írd be újra ezt a sort a "--test" nélkül. Az én esetemben volt egy figyelmeztetés az aláírással kapcsolatban. Úgy döntöttem kihagyom!
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.  
+
- FELHASZNÁLÓI módban, írd be, hogy "switch", és válaszd ki a "galaxy" témát.
  
The Lazarus / FPC tool is now installed!
+
 
 +
A Lazarus / FPC mostmár telepítve van!
  
 
===== Lazarus 0.9.28 on Mandriva 2007/or -2006 32 bit =====
 
===== Lazarus 0.9.28 on Mandriva 2007/or -2006 32 bit =====

Revision as of 14:55, 15 January 2010

Deutsch (de) English (en) español (es) suomi (fi) français (fr) magyar (hu) 日本語 (ja) 한국어 (ko) polski (pl) português (pt) русский (ru) slovenčina (sk) Tiếng Việt (vi) 中文(中国大陆)‎ (zh_CN)

Áttekintés

Azoknak, akik egyszerűen csak telepíteni és használni szeretnék a Lazarus-t programozáshoz, a legegyszerűbb megoldás letölteni egy friss, stabil bináris kiadást (mint pl. egy ".rpm" csomag, vagy egy Windows-os ".exe" telepítő, vagy egy Mac OS X-es ".dmg" csomag). Elolvashatod a Linux és Windows szakaszokban a "Futtatható FPC" fejezetet, vagy az első bekezdéseket a "Lazarus telepítése Windows-ra" vagy a "Lazarus telepítése Linux-ra" fejezetekben; a többit nyugodtan kihagyhatod.

Azok számára, akik szeretnének közreműködni a fordító vagy fejlesztő környezet fejlesztésében, vagy akik a legfrissebb eszközöket akarják, forrás fájlokból kell a telepítést végrehajtani, és legtöbb további információ is szükséges.

A Lazarus két fő részből áll:

  • LCL - a Lazarus Komponens Könyvtár
  • IDE - a vizuális fejlesztőkörnyezet

Ebből következően a következő függőségek is szükségesek:

  • FPC - a FreePascal fordító
  • FCL - a FreePascal Komponens Könyvtár, tartalmazza a legtöbb nem grafikus Lazarus által használt komponenst

A Lazarus rendszerkövetelményei

  1. FreePascal fordító, csomagok, és források. (*FONTOS*: ugyanolyan verziószámmal/dátummal)
  2. Egy támogatott widget eszközkészlet
    Win32
    A natív Win32 API használható
    Linux/xxxBSD
    GTK+ 2.x : A legtöbb Linux disztribúció és a *BSD-k alapértelmezetten telepítik a GTK+ 2.x könyvtárait, amelyek megtalálhatók a http://www.gtk.org címen is.
    Mac OS X
    Szükséged lesz az Apple fejlesztőeszközökre. Lásd a "Telepítés Mac OS X-re" fejezetben.

A GYIK - Gyakran Ismételt Kérdések fájl elérhető a http://www.lazarus.freepascal.org címen. Néhány kérdés szintén megtalálható a helyi 'GYIK' fájlban.

A következő fejezetek leírják, hogy hogyan szerezzük meg a FreePascal-t, és hogyan telepítsük megfelelően a Lazarus-t.

A Free Pascal fordító telepítése

Egy részletes leírás található a Free Pascal fordítók telepítéséről és fordításáról a http://www.stack.nl/~marcov/buildfaq.pdf címen - ez talán egy kicsit túl részletes néhány felhasználó számára, de nagyon precíz.

A Lazarus az FPC (FreePascal) 2.2.4-es vagy nagyobb verzióját igényli lefordított és forrás állapotban is, természetesen ugyanolyan verziószámmal.


A Free Pascal telepítése Linux-ra

Futtatható FPC

A FreePAscal legutóbbi kiadása (2.2.4-es verzió), megszerezhető a FreePascal weboldalról (http://www.freepascal.org/download.html, aztán tükör kiválasztásával) vagy a SourceForge-ról (http://sourceforge.net/projects/lazarus).

A Lazarus letöltések szekcióban (http://www.lazarus.freepascal.org) megtlaálod a FreePascal fordító (compiler / linux) RPM-jét vagy DEB-jét. Ha nem RPM vagy debian alapú disztribúciód van, akkor letöltheted és telepíthetek a tarball-okat a http://www.freepascal.org-ról. Ha magadnak akarod lefordítani a forrást, nézd meg a BSD szakaszt.

Instrukciók:

FIGYELEM: ha nem használsz RPM-et vagy debian csomagokat (még ha alien hasznáatát is tervezed) a legjobb a legutóbbi stabil fpc-t (jelenleg 2.2.4) beszerezni és forrásokból telepíteni a Lazarus-t.

Indítsd el a Linux-ot és jelentkezz be ROOT-ként.

Töltsd le a legutóbbi fájlokat a http://sourceforge.net/project/showfiles.php?group_id=89339-ről. Például:

  • fpc-2.2.4-0.i386.rpm
  • fpc-src-2.2.4-0i386.rpm
  • lazarus-0.9.28-0.i386.rpm

és telepítsd őket így:

  • rpm -Uvh fpc-2.2.4-0.i386.rpm
  • rpm -Uvh fpc-src-2.2.4-0.i386.rpm
  • rpm -Uvh lazarus-0.9.28-0.i386.rpm

Debian felhasználóknak az alien használatához (figyelem, nem hozza létre az fpc.cfg-t) vagy a tarball telepítéshez kell folyamodniuk.

FPC Források

A 2.0-ás verzió megjelenése óta az FPC átváltott SVN-re. Jelenleg nincs CVS tükör, tehát SVN-t kell használnod, hogy megszerezd az FPC forrásokat.

Napi forrás snapshot letöltése a fejlesztői fából (2.5.1-es verzió)

Letöltheted a mai (v2.5.1) fejlesztői forrásokat csomagolt snapshot-ként az SVN tárhelyről: ezek a snapshot-ok napi szinten vannak frissítve, és tükrözik a forrás tárhely állapotát. Nincsenek tesztelve, lehet hogy nem fognak működni, vagy összeomlasztják a rendszeredet. A fájlok az SVN archívum oldalán vannak tárolva. A v2.5.1 teljes publikus forrásarchívuma: http://www.hu.freepascal.org/lazarus/

Napi forrás snapshot letöltése a kiadás fából (2.3.1-es verzió)

Letöltheted a mai (v2.3.1) fejlesztői forrásokat, amelyek a következő stabil verzió alapját képezik. Nincsenek tesztelve, lehet hogy nem fognak működni, vagy összeomlasztják a rendszeredet. A v2.3.1 teljes publikus forrásarchívuma: http://www.hu.freepascal.org/lazarus/

Csatlakozás forrás tárhelyhez SVN-nel (kiváltja a CVS-hez kapcsolódás szekciót)

A napi SVN források zip fájljainak alternatívájaként, az SVN tárhely elérhetővé vált mindenki számára, csak olvasható hozzáféréssel. Ez azt jelenti, hogy közvetlenül elérheted a kódot, így tényleg a legutóbbi forrásokhoz juthatsz hozzá. Továbbá ezzel az eljárással lecsökken a szükséges sávszélesség is, azután, hogy az első letöltés megtörtént (lásd SVN lingo).

Fejlesztői snapshot-ok

Hogyan csináljuk ezt?

(Telepített SVN-re lesz szükséged, természetesen. Lásd itt az útmutatót, hogy hogy csináld.)

Válts mappát (cd) a fejlesztői területed szülő könyvtárába, pl:

[]$ cd /home/username/FreePascal

A teljes tárhely letöltéséhez, minden nyilvánosan elérhető modulhoz, írd be:

[]$ svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc

Alap esetben, ezt a lépést csak egyszer kell végrehajtani.

Hogy frissítsd a forrásokat, amik le lettek töltve (checkout) feljebb:

[]$svn update fpc
Javítások a 2.2.x-hez

A javításoknak egy külön mappa kell, hozz létre egy "fixes" nevű mappát, lépj bele, és ismételd meg az előbbi checkout parancsot a http://svn.freepascal.org/svn/fpc/branches/fixes_2_2 URL-lel:

[]$ cd mysvn/fixes
[]$ svn checkout http://svn.freepascal.org/svn/fpc/branches/fixes_2_2 fpc

és a frissítéshez:

[]$ svn update fpc

A dokumentációk forrásai egy külön forrásban (fpcdocs) vannak, tehát ahhoz, hgoy megszerezd őket, ezt a parancsot kell végrehajtani:

[]$ svn checkout http://svn.freepascal.org/svn/fpcdocs/trunk fpcdocs

Ha többet akarsz megtudni az SVN-ről, olvasd el ezt a remek Subversion könyvet, ami szintén online hozzáférhető különböző formátumokban, ingyenesen.

A kíváncsiskodók kedvéért: Csak olvasható hozzáférésed van, úgyhogy ne próbálj meg bármit is végrehajtani :-)

További információkért nézd meg a FreePascal weboldalát.

Free Pascal telepítése Windows-ra

Bináris FPC Windows-ra

Messze a legegyszerűbb módja egy működő Free Pascal telepítésnek a Lazarus legfrissebb Windows-os binárisának letöltése a SourceForge tárhelyről [1] - a kiadás tartalmazza a FreePascal fordítót és a FreePascal könyvtárakat, éppúgy, mint a Lazarus IDE-t.

Ha minden forrást telepíteni akarsz, olvass tovább!

Az FPC 2.2.4 telepítő zip fájlját a Free Pascal letöltési szekciójában találod meg (http://www.freepascal.org/download.var, majd válassz egy tükröt). Telepítés a forrásokból - megszerzésüket lásd a következő szakaszban - nem kezdőknek való, mivel egy induló fordítóra is szükség van hozzá.

FPC források Windows-ra

<<<< Linux-hoz lásd a feljebb lévő szakaszt az FPC forrásokban, ahol az SVN használata le van írva >>>>

A Free Pascal források megszerzésének legegyszerűbb módja az SVN; lásd a következő szakaszt a részletekért. Letöltheted a csomagot is egyben -- lásd a http://www.freepascal.org/develop.html oldalon a v2.5.x kiadás fájának napi snapshot-ját.

Windows FPC források SVN-nel

Szükséged lesz egy SVN kliensre (pl. TortoiseSVN) ahhoz, hogy a következő lépéseket végrehajthasd. A pontos parancsok eltérőek a különböző SVN klienseken; az alul megadottak a használandók az SVN home kliensén, ami letölthető innen.

Először hozz létre egy mappát, amibe tenni szeretnéd a forrásokat. Bármelyik alap felhasználó meg tudja ezt csinálni. Készíts egy mappát az FPC-nek (pl. C:\Source), aztán hajtsd végre ezeket a parancssorban:

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

Tipp: Ahhoz, hogy letöltsd/frissítd a legújabb változásokat, a következőt teheted:

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

Lásd: http://www.freepascal.org/download.var. A tükrök listáját itt találod: http://www.freepascal.org/down/source/sources.var. Töltsd le az FPC-t egy nagy fájlként, csomagold ki és futtasd az install.exe-t.

A PATH változó kibővítése az FPC mappával:

  • Win98: Szerkeszd az autoexec.bat-ot és add hozzá a következő sort: PATH=%PATH%;C:\pp\bin\bin\win32
  • WinXP/2k: Sajátgép (jobb klikk)-> Tulajdonságok -> Haladó (Oldal) -> Környezeti változók -> Rendszerváltozók -> Szerkeszd a "PATH"-t, add hozzá a "C:\pp\bin\bin\win32"-t.

Ezután indítsd újra a Windows-t.

Miután az FPC binárisokat telepítetted le tudod fordítani az FPC forrást subversion-ből.

Tippek:

  • Windows (7+) alatt emeltebb felhasználói szintű parancssor szükséges. A Start menüben a "Parancssor"-ra jobb gombbal klikkelve válaszd ki a "Futtatás rendszergazdaként" menüpontot.
  • A SAJÁT-ELŐTAG teljesen attól függ, hogy hová telepítetted az FPC-t. Alapértelmezett ennek a szövegnek az írása közben: a "C:\FPC"-be irányított binárisok a "c:\FPC\2.2.4"-be kerülnek. Linux alatt a make telepítő szkriptek úgy vannak beállítva, hogy egy új IFF almappát hozzanak létre az utolsó fordítás óta megváltozott verziójú FPC-nek. A Windows szkriptek nem ilyenek. Tehát, ha ismered az almappa nevét (pl. 2.5.1), akkor megadhatod azt. Ellenben, mivel a verziók gyakran változnak, ajánlott, hogy válassz ki és kezelj egy FPC verzióktól független egyszerű ELŐTAGOT. Egy jó előtag a C:\FPC de meg kell győződnöd róla, hogy a C:\FPC\bin\i386-win32\ mappa is hozzáadódott a környezeti változódhoz (lásd feljebb, hogy hogy tudod beállítani és megváltoztatni a bináris verzióról a frissen fordítottra).

Instrukciók:

  • A parancssorban keresd meg a lokalizált FPC forrást. pl. írd be: "cd c:\Developer\FPC"
  • Az FPC fordításához írd be: "make all"
  • A létező FPC felülírásáhazo írd be: "make install PREFIX=SAJÁT-ELŐTAG"
  • A forrás telepítéséhez írd be: "make install sourceinstall PREFIX=SAJÁT-ELŐTAG"

Free Pascal telepítése FreeBSD-re (automatikusan)

A legfrissebb FreeBSD port gyűjtemény a v2.2.4 stabil verziót tartalmazza a ports/lang/fpc-ben. De több, mint 57 (!) csomagra van bontva, és nem telepíti a forrásokat, úgyhogy szinte mindig jobb manuálisan telepíteni (lásd lejjebb). Ennek ellenére itt van, hogy hogy kell a telepítést végrehajtani.

Ez root-ként tehető meg.

[]# cd /usr/ports/lang/fpc && make install && make clean

A másik lehetőség a portinstall használata.

[]# portinstall fpc

Amint az FPC telepítve van, szimpla futtatással ellenőrizheted, hogy működik-e

[]$ fpc

A Free Pascal telepítése Linux/BSD-re manuálisan

Amire szükséges lesz:

Egy fájl minden forrással, vagy kettő (FPC és Lazarus)

1. pl. FPC-hez ftp://ftp.freepascal.org/fpc/dist/2.2.4/source/

2. Lazarus forrás snapshot.

  • Bármilyen induló fordító a v2.2.4-es ágból. A verziót leellenőrizheted a "ppc386 -i" paraccsal (2.2.4 .. 2.5.x-ig OK).
  • függőségi cosomagok. (FreeBSD-hez: gtk2, glib2 és a GNU make, iconv és gettext)

FPC fordítás:

1. készítsd elő a szükséges fájlokat (FPC forráskód, induló fordító) 2. csomagold ki őket a work mappába, 3. lépj be a work/fpc/-be és írd be:

 $MAKE all OPT='-gl -O3p3'  PP=/útvonal_az_induló_fordítóhoz/fordító_neve_ppc386
(/útvonal_az_induló_fordítóhoz/ elhagyható, ha éppen abban a mappában vagy, ahol a ppc386)
($MAKE linux-on és gmake BSD-n)

4. ezután, újra a work/fpc-ben, futtasd a következőket:

$MAKE install PP=compiler/ppc386 PREFIX=$THEPREFIX
(THEPREFIX= általában /usr/local vagy just /usr, de pl. NetBSD-n /usr/pkg)
Készíts egy szimbolikus linket:
  ln -s $THEPREFIX/lib/fpc/2.2.4/ppc386 $THEPREFIX/bin/ppc386
Telepítsd a forrásokat:
  $MAKE install sourceinstall PREFIX=$THEPREFIX
Készíts egy szimbolikus linket az alapértelmezett Lazarus forrás útvonalhoz:
 ln -sf $THEPREFIX/share/src/2.2.4/fpc /usr/share/fpcsrc

5. futtatás:

 $THEPREFIX/lib/fpc/2.2.4/samplecfg $THEPREFIX/lib/fpc/2.2.4 $ETCDIR

6. (szabadon választott), nézd meg, hogy van-e kimenete a "ppc386 -i" parancsnak, vagy csak egy figyelmeztetést ad, hogy a felhasználónak hozzá kell adnia $PREFIX/bin-t a jelenlegi elérési úthoz. Próbálj meg lefordítani egy programot a -viwn paranccsal, és nézd meg, hogy ad-e hibát. Megjegyzések:

  • Ha szükséged van az fpcmake csomaglistákra, saját magadnak kell létrehoznod őket, (a port-ban vagy külső archívumban). Mindkét esetben, készíts egy látszólagos telepítése a /tmp/pack-be és állapítsd meg a "find . > ll"-lel, hogy melyik fájlok lettek telepítve.
  • $THEPREFIX és $ETCDIR felhasználó által megadandók. Máskülönben helyi telepítések nem lehetségesek.
  • a BSDHIER=1 minden parancsban a BSD hierarchia konvenciókat erőlteti.

Free Pascal telepítése Mac OS X-re

Lásd a Lazarus telepítésre MacOS X-re szakaszban.

Lazarus telepítése

Lazarus telepítése Linux-ra

Ubuntu / Debian

A legkönnyebb módja egy működő telepítés elérésének a .deb fájlok letöltése a SourceForge tárhelyéről. Itt van, hogy hogyan:Getting_Lazarus#Getting_Lazarus_from_our_Ubuntu_repository.

Megjegyezzük, hogy az alapértelmezett Ubuntu források nem telepítik a Free Pascal forrás könyvtárakat - használd a fentebb leírt eljárást.

Deb-ek fordítása a könnyű úton

Egy jó működőképes telepítés megszerzésének a legkönnyebb útja saját .deb csomagok létrehozása az itt elérhető útmutató alapján:

How_to_setup_a_FPC_and_Lazarus_Ubuntu_repository

GTK2 alkalmazások fordítási problémái FPC 2.2.2-vel

Michalis Kamburelis bejegyzése alapján:

Abban az esetben, ha valaki nem tudja, hogy küszöbölje ki ezt a hibát (GTK >= 2.13.4 esetén lép fel, pl. Ubuntu 8.10-en GTK 2.14 van):

Azt találtam, hogy a gyors megoldás, ami működik is, az --noinhibit-exec küldése az ld-nek, ami a "-k--noinhibit-exec" kapcsoló az FPC parancssorába. Az ld ezután a nem feloldott referenciákat puszta figyelmeztetésként fogja kezelni, és működőképes futtatható fájlt készít (feltéve, hogy a programod nem használ idejétmúlt GTK2 függvényeket).

Természetesen, frissíthetsz a legújabb 2.2.4-es FPC kiadásra. Az előbbi megoldás csak akkor hasznos, ha mindenképpen a régebbi, 2.2.2-es FPC-t kell használnod.

Telepítés rpm-mel

A következő legegyszerűbb út az RPM-ek használata a SourceForge tárhelyéről.

Le kell töltened a kiválasztott verzióját a

  • fordítónak (pl. fpc-2.2.4-0.i386.rpm)
  • a pascal forrás könyvtárnak (pl. fpc-src-2.2.4-081004.i386.rpm)
  • a Lazarus csomagnak (pl.g lazarus-0.9.28-0.i386.rpm).

Itt egy példa szkript a 0.9.28-as verzió telepítéséhez, vagy a 0.9.28-ra való frissítéshez. Mentsd el valami olyasmiként, mint "InstallLazarus.sh", adj neki futtathatósági jogot, és futtasd root jogosultsággal, pl. su használatával. Ne törödj vele, ha "not installed" (nincs telepítve) üzenetet kapsz.

 #!/bin/sh
 URL=http://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20i386%20RPM/Lazarus%200.9.28
 wget $URL/fpc-2.2.4-0.i386.rpm/download
 wget $URL/fpc-src-2.2.4-0.i386.rpm/download
 wget $URL/lazarus-0.9.28-0.i386.rpm/download
 rpm -ev lazarus
 rpm -ev fpc
 rpm -ev fpc-src
 rpm -ivh fpc-*
 rpm -ivh lazarus-*

Telepítés Mandrivá-ra

Lazarus 0.9.28 Mandriva 2010-re

Telepítsd a lentebb megadottaknak megfelelően, annak ellenére, hogy a fordítás közben hibaüzenetet fogsz kapni arról, hogy a pixbuf 2.0 és az lgtk-x11-2.0 hiányzik. Hogy ezeket megszüntesd, telepítsd a libdgk_pixbuf2.0_0-devel-t és libgtk+2.0_0-devel-t a telepítőből.

Lazarus 0.9.28 Mandriva 2009-en (2009.0) (i386) (GTK-2)

Nem sok változott a Mandriva 2007-hez képest. A következő útmutató nem tér x86_64 esetén sem.

1/ Ne telepítsd az FPC a Drake-ből. Ha mégis így tetted, távolítsd el. Mivel a Mandriva nem szolgáltat teljes értékű eszközkészletet (FPC + források + dokumentáció + Lazarus), ezért véleményem szerint jobb, ha ellenőrzésünk alatt áll mindegyik az rpm-eken keresztül.

2/ Gyűjtsd be a friss rpm-eket a sourceforge-on (http://sourceforge.net/project/showfiles.php?group_id=89339): válaszd ki a legutóbbi Lazarus kiadást, ami a te architektúráddal kompatibilis és töltsd le az fpc-t, fpc-src-t, fpc-docs-t, és a Lazarus rpm-eket.

3/ Nyisd meg a mappát, ahová az rpm-eket letöltötted (Nautilus-szal vagy bármilyen más fájl böngészővel) és klikkelj duplán az rpm-ekre ebben a sorrenben:

  (a) fpc-<verzió>-<arch>.rpm
  (b) fpc-docs-<verzió>-<arch>.rmp
  (c) fpc-src-<verzió>-<arch>.rpm
  (d) lazarus-<verzió>-<arch>.rpm

4/ Elképzelhető, hogy a Drake (a szoftver, ami az rpm-eket fogja kezelni) panaszkodni fog, hogy könyvtárak, és eszközök hiányoznak. Használd a Drake-et, hogy begyűjtsd őket. Például, telepítened kellet volna olyan fejlesztő eszközöket, mint a "GNU Make". Keresd meg, és ha szükséges, telepítsd a "GNU Make"-et. Lehet, hogy hiányozni fog ld (összefűző segédprogram) is. Ehhez telepítheted például a "gcc" csomagot.

5/ Mint ez előtt is, megkeresheted és telepítheted a "galaxy-gnome"-ot és a "gtk-switch"-et a Drake-kel. Egyik sem szükséges a Lazarus megfelelő működéséhez. A Gnome Galaxy király témák gyűjteménye, amit a Rendszer menü -> Beállítások -> Témák menüben alkalmazhatsz.

6/ A Lazarus panaszkodhat az FPC források miatt, hogy nincsenek megfelelően beállítva. Menj a Konfiguráció -> Környezet menübe, és állítsd be az FPC források mappáját a helyi telepítésedére (ez lehet pl. /usr/local/fpcsrc/<verzió>/).

7/ Indításokr, lehet, hogy a libcanberra-module-gtk nem lesz található. Próbáltam létrehozni egy szimbolikus linket (ln -s), de ha a Lazarus próbálja meg megkeresni ezt a könyvtárat, összeomlik... Biztonságosabb, ha ezt inkább kihagyod.

8/ Sok sikert az ingyenes világ legkirályabb gyors alkalmazásfejlesztőjéhez!

Lazarus 0.9.26 Mandriva 2007-en (2007.0) (i386) (GTK-1)

A telepítés Mandrivá-n nagyon egyszerű. Ellenben, van néhány pont, amit ellenőrizni kell a telepítés során. Itt egy tipikus telepítés a .tar modulok használatával (nézd meg a témákkal kapcsolatos trükköt a művelet végén!):

- A Mandriva telepítése közben válaszd ki a "Gnome asztal" csoportot. Ha KDE-ben vagy más ablakkezelőben fogod használni a Lazarust, akkor is fontos ez, mivel néhány szükséges GTK modult fog telepíteni.

- Telepítsd az FPC 2.2.2-es fordítót vagy .rpm vagy .tar használatával. A .tart modulok esetén ezt a parancsot kell kiadni: "sh install.sh", aztán sokszor enter-t nyomni. Én superuser módban szoktam csinálni.

- Telepítsd a fordító forráskódját. Csak tar-old ki az "fpc-src-2.2.4.source.tgz" fájlt a /usr/local/src/fpc/ mappába, és nevezd át a létrehozott "fpc" mappát "2.2.2"-re. Ha kész van, van egy /usr/local/src/fpc/2.2.2/ mappád, ami tartalmazza a teljes forráskódot. A forráskód csak a Lazarus szerkesztőhöz szükséges, de akár újrafordíthatod belőle az FPC-t, hogy optimalizált könyvtáraid legyenek.

- Ha le akarod fordítani az FPC-t (opcionális), akkor menj az FPC forrásmappába (/usr/local/src/fpc/2.2.4/) és írd be: "./configure", "make clean", "make all", "make install", "make clean". És az FPC telepítve van. Ellenőrizd az "/etc/fpc.cfg" tartalmát. Ezt a fájlt módosítani kell, ha a make hibára leáll.

- A Lazarus felhasználói módban is telepíthető: csak zip-eld/tar-old ki a "lazarus-0.9.26.0.tar.gz" fájlt a saját mappádba. Azután csak írd be: "make clean all" felhasználói módban. A folyamat utolsó fázisa (összefűzés) általában sikertelen a hiányzó könyvtár fájlok miatt:

- Ellenőrizd a /usr/lib/ mappában, hogy léteznek-e a következő szimbolikus linkek:

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

A "libgdk_pixbuf.so.2.0.0" fájl a "libgdk_pixbuf-2.0.22.0-10mdv2007.0.rpm" modulban van. Ez a fájl név kritikus. Különösképpen a "libgdk_pixbuf-2.0.so.0"-t NE használd (félrevezető, ugye?).

Minden link javítása után, a "Linking ../lazarus" lépés nem fog többé összeomlani és a "./lazarus" parancs indítja a programot!

- Menj a Környezet -> Környezet beállításai menübe és változtasd meg az "FPC forrás mappáját" /user/local/src/fpc/2.2.4 -re

JÓ TUDNI:

- Az utolsó lépés a téma megjavítása. A "galaxy-gnome-1.0.4-3mdv2007.0" csomag elérhető a Mandriva vezérlő központból. Telepítsd fel.

- A "gtk-theme-switch-1.0.1-4mdv2007.0.i586.rpm" elérhető a weben! (furcsa módon nem jelenik meg a vezérlőközpontban) Telepítsd kézzel az "rpm -iv --test gtk-theme-switch-1.0.1-4mdv2007.0.i586.rpm" paranccsal, aztán írd be újra ezt a sort a "--test" nélkül. Az én esetemben volt egy figyelmeztetés az aláírással kapcsolatban. Úgy döntöttem kihagyom!

- FELHASZNÁLÓI módban, írd be, hogy "switch", és válaszd ki a "galaxy" témát.


A Lazarus / FPC mostmár telepítve van!

Lazarus 0.9.28 on Mandriva 2007/or -2006 32 bit

Write this urpmi-command as root:

urpmi http://surfnet.dl.sourceforge.net/sourceforge/lazarus/lazarus-0.9.28-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-2.2.4-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-docs-2.2.4-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-src-2.2.4-0.i386.rpm

Lazarus 0.9.28 depends on fpc 2.2.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 0.9.28 on Mandriva 2009 32 bit

Installation needs similar action as above. Because the distribution comes with fpc-2.2.4-1, it is necessary to uninstall this package. Write following commands as root:

rpm -e fpc
urpmi http://surfnet.dl.sourceforge.net/sourceforge/lazarus/lazarus-0.9.28-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-2.2.4-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-docs-2.2.4-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-src-2.2.4-081004.i386.rpm

And place 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 X86_64

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

fpc-2.2.4-0.x86_64.rpm
fpc-src-2.2.4-091006.x86_64.rpm
lazarus-0.9.28-0.x86_64.rpm
  • To download and 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 )
You might have to install lynx and make first: urpmi lynx make.

  • 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

Installing on Slackware

Installing Lazarus 0.9.28, 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.4.i386-linux.tar" in a user folder and install it. Go to this folder and type:

 bash-3.1$ tar -xvf fpc-2.2.4.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.4 [] for i386 
 Copyright (c) 2008 ...
 ...
 ...

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.4.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.4.source.tar.gz
 bash-3.1$ cd fpc-2.2.4
 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.4 [...] for i386 
 Copyright (c) 2008 ...
 ...
 ...

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.4.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.4.source.tar.gz /usr/local/src/
 bash-3.1# cd /usr/local/src/
 bash-3.1# tar -xvzf fpc-2.2.4.source.tar.gz
 bash-3.1# rm fpc-2.2.4.source.tar.gz
 bash-3.1# exit

The version number is included in the folder name "fpc-2.2.4". 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.28-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.4". Note that when you change this folder, you should click on "Environment / Rescan_FPC_source_directory".

Voila!

Installing on openSUSE

Installing Lazarus 0.9.28. For openSUSE 11.1 users

Free Pascal Compiler requires:
- Gnu binutils (gnu as, gnu ld, gnu make) These utils can be installed by:

 zypper in -t pattern devel_basis

Lazarus also requires these components: 1) glib2 devel 2) gtk2 devel

Important: The lazarus rpm requires the gtk 2 version, not the version 1.2.

These libraries can be installed by:

 zypper -n install gtk2 glib2

Download these binary files (RPM)

  • fpc-2.2.4-0.i386.rpm (yes i586 and not i386)
  • fpc-src-2.2.4-0.i386.rpm
  • lazarus-0.9.28.2-0.i586.rpm

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

 rpm -Uvh fpc-2.2.4-0.i386.rpm
 rpm -Uvh fpc-src-2.2.4-0.i386.rpm
 rpm -Uvh lazarus-0.9.28.2-0.i586.rpm

Installing from source

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 svn.

Here is an example of installing 0.9.28 to Ubuntu 6.06. If you understand Linux commands and bash script, you can get what steps are needed. Just copy the script (change the version number when new version has been released), paste it into a text editor, and save it as something like "install_lazarus.sh". Give it execute permission, and run it in a console. Note: In this example, fpc is installed in /opt. So when prompted 'Install prefix', enter '/opt/fpc'.

 #!/bin/sh
 
 #installing required packages
 sudo apt-get install build-essential
 sudo apt-get install libgtk2.0-dev
 sudo apt-get install libgdk-pixbuf-dev
 
 #installing FreePascal source
 cd /opt
 sudo wget http://nchc.dl.sourceforge.net/lazarus/fpc-src-2.2.4.source.tgz
 sudo tar -xvf fpc-src-2.2.4.source.tgz
 sudo mv fpc fpcsrc
 
 #installing FreePascal
 sudo mkdir fpc
 cd fpc
 sudo wget http://nchc.dl.sourceforge.net/lazarus/fpc-2.2.4.i386-linux.tar
 sudo tar -xvf fpc-2.2.4.i386-linux.tar
 echo "Enter '/opt/fpc' when prompted 'Install prefix'"
 sudo sh install.sh
 
 #adding fpc path to the PATH
 echo "#FPC PATH" >> ~/.bash_profile
 echo "if [ -d /opt/fpc/bin ] ; then" >> ~/.bash_profile 
 echo PATH=/opt/fpc/bin:"${PATH}" >> ~/.bash_profile
 echo "fi" >> ~/.bash_profile
 
 #installing Lazarus
 cd ../
 sudo wget http://nchc.dl.sourceforge.net/lazarus/lazarus-0.9.28-0.tar.gz
 sudo tar -zxvf lazarus-0.9.28-0.tar.gz
 PATH=/opt/fpc/bin:"${PATH}"
 sudo chmod -R 777 lazarus
 cd lazarus
 make clean all
 ./lazarus

Note: You have to manually set fpc-src path in the Environmental Options.

Downloading Lazarus Source Code

The lazarus repository has moved from cvs to svn (Subversion). SVN 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 need to be root.

Please note these instructions are for SubVersion, but there is also a Git mirror repository of Free Pascal Compiler and Lazarus. For more instructions on using Git, follow this link: Git mirror

Lazarus does not need any special permissions, neither during installation nor at runtime.

With the move we also changed the directory layout of the lazarus sources. The main difference is that all ide sources are moved from the root to a separate ide subdir. As anybody might understand, this has an impact on the Makefiles, the searchpaths etc. We are in progress of fixing things, so if something doesn't work, please let us know.

Now the most important thing.... getting the sources
 []$ svn checkout http://svn.freepascal.org/svn/lazarus/trunk/ lazarus

(or any other dir where you want to place your sources)

On subsequent occasions, to update simply type

 []$ svn update lazarus

For more information on Subversion, see: http://subversion.tigris.org/

Note: the CVS is still accessable, but is frozen. This means that no new updates are comitted.

Compiling and running

Whether you checkout from cvs or svn, the next step is:

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'.

See here for the documentation about this dialog: IDE_Window:_Environment_Options

Hint

To update lazarus you can use

[]$ svn update lazarus

then for either update pathway:

[]$ 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:

[]$ ./lazbuild --build-ide=

Installing Lazarus under Debian GNU/Linux

There are preliminary Debian packages for lazarus available for download. They are not the latest versions, however. 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>.

Note that for a fully working Lazarus install, no older or incompatible versions of, for example, the fpc source or fpc compiler must be installed. Remove them by typing

 dpkg -r <package name>   

without .deb extension. And then install the newest versions as described.

Installing Lazarus 64 bit version on Red Hat EL 5

Linking may fail when you do your first compile with an error "incompatible libglib" if the following symbolic links are not present in the /usr/lib64/ directory

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

The steps for successful installation on Red Hat were

yum install gimp gimp-devel gtk+* gtk+-devel

Then install the following rpms

fpc-2.2.4-0.x86_64.rpm fpc-docs-2.2.4-0.x86_64.rpm lazarus-0.9.28.2-0.src.rpm lazarus-debuginfo-0.9.28.2-0.x86_64.rpm fpc-2.2.4-3.fc10.x86_64.rpm fpc-src-2.2.4-091006.x86_64.rpm lazarus-0.9.28.2-0.x86_64.rpm

add -Fl/usr/lib64 under #ifdef cpux86_64 in fpc.cfg

Then add the symbolic links listed above.

Fedora Core 11

Needed packages:

gtk2-devel glibc-devel binutils

Useful packages for development:

subversion wget gcc bison rpm-build

Installing Lazarus under Windows

The current releases of the Windows Lazarus binary packages install very easily, and should work 'out-of-the-box'.

It is even possible to install the whole Lazarus/FPC package on a portable USB drive (capacity at least 256 MB), for use in environments where you are not allowed to install software on your Windows workstation or where you haven't got administrator privileges. You do have to be a little careful about adjusting the paths in the compiler and environment options and the fpc.cfg file. It may also be necessary to keep the directory for test compilation on your portable drive.

<< Q:DOES ANYONE KNOW HOW TO SET UP RELATIVE PATHS IN THESE TAGS AND FILES, SO THAT THE ADDRESSING WORKS WHEN YOU MOVE THE USB DEVICE TO ANOTHER MACHINE WHERE IT HAS A DIFFERENT DRIVE LETTER?

A: This is what I do. It's relatively convoluted, but it's the best solution I've found. I have a "bin" directory on my USB drive, where I have several scripts and utilities installed. Inside that directory is a batch file called "setenv.bat" which sets an environment variable called THUMBDRIVE. It is set by using this command in the batch file:

  set THUMBDRIVE=%CD:~0,2%

This is used in setenv.bat to set some paths to other things I have installed on the USB drive. I also have a link in the root directory of the thumb drive with this property:

 %SystemRoot%\system32\cmd.exe /k bin\setenv

so that when I click on that link when the thumb drive folder is diplayed after inserting it, it will open a command prompt at the thumb drive with the environment variables set from setenv.bat.

Also inside the bin directory is sed (the actual binary is one I obtained from the mingw distribution). So I created another batch file called fixlaz.bat which takes one argument, the drive letter which is currently in the Lazarus/fpc settings files that you want to change (note that this is the previous drive letter the last time you ran fixlaz.bat, not the current one of your USB drive which fixlaz.bat already knows). You will need to create this batch file to fit where you installed Lazarus in the root directory structure of the drive if you didn't install it directly in the root folder, and then repeat these lines also for the editoroptions.xml and fpc.cfg files (fpc.cfg is the the fpc bin directory, which might be buried deep in the lazarus folder):

 copy %THUMBDRIVE%\lazarus\environmentoptions.xml %THUMBDRIVE%\lazarus\environmentoptions.bak
 sed -e 's/%1/%THUMBDRIVE%/g' %THUMBDRIVE%\lazarus\environmentoptions.bak > %THUMBDRIVE%\lazarus\environmentoptions.xml

So to use it, I would type at the command prompt of the USB drive:

 fixlaz G:

if "G:" was the previous drive letter used the last time I ran it. This will then scan the file(s) and replace "G:" with the current drive letter of the USB drive, which is in the %THUMBDRIVE% environment variable (after running setenv.bat). Note that you could write it to save the current drive letter in a separate file, so that you wouldn't have to remember it yourself the next time. But this works well enough for me right now. >>

The binary package is available for Linux and Windows from

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

Download the latest release (currently Lazarus-0.9.28-0-win32.exe) and launch the application. You will be taken through a typical Windows installation, in which the FPC compiler and source libraries are installed within the same directory structure as Lazarus, and the IDE should launch and operate without significant problems, provided you have uninstalled(!!!) any previous version of Lazarus and/or FPC (often found in the C:\pp directory).

You can also use a Lazarus Snapshot. For download locations see Lazarus Snapshots Downloads.

Tip: It's perhaps a good idea to reboot your Windows after you installed Lazarus and before you try to install additional lazarus components as zeoslib fore example.

Installing from source

If you prefer to install from sources, then follow these instructions (Thanks to Joe for the initial Step-by-step description). Please note these instructions are for SubVersion, but there is also a Git mirror repository of Free Pascal Compiler and Lazarus. For more instructions on using Git, follow this link: Git mirror


You have to download the lazarus source from one of the snapshots servers. Then unzip it to c:\lazarus for example [below called $(LazarusDir)].

Or you use SVN:

 []$ svn checkout http://svn.freepascal.org/svn/lazarus/trunk/

You have to install at least fpc-2.2.4, but a fpc-2.5.1 snapshot is also possible. It compiles for me, and lazarus.exe works. The path to my fpc is: c:\pp\bin\win32. In this directory you can find a lot of exe (make, grep, ppc386, and so on).

Open a command line. Start->Run...>command or choose MS-DOS icon.

Type:

//Replace $(LazarusDir) with the path you have unzipped/checked out Lazarus
cd $(LazarusDir)\ide
set path=c:\pp\bin\win32;$(LazarusDir)  //of course change the first to
                                        //the path of yours
windres -i lazarus.rc -o lazarus.res
cd $(LazarusDir)
make

If you are lucky then you can type: lazarus.exe. The source editor, dialogs and the property editor work, but not perfectly... Look and you will see.

You can compile examples also:

cd $(LazarusDir)\examples
make

If you extracted lazarus to another drive, eg.: d:\lazarus. It can happen that you need the gnu utility to make it. If you have it, you can take its path to set path=...;<gmakepath> but it is simpler not to choose drive d:\

That's all.

Installing Lazarus under FreeBSD

FreeBSD 6+

The latest version of Lazarus into FreeBSD port tree is 0.9.28.2. 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

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

Works pretty much the same as under Linux. But you first need to install the Apple developer tools.

More elaborate instructions can be found in Installing Lazarus on MacOS X.

To install the Lazarus itself, easy-to-install snapshots are available from the snaphot servers.

If you install all 3 .dmg snapshot files, this also installs the FPC compiler and the FPC and Lazarus source too. If you only need to run Lazarus to develop and compile your own apps, you don't need to install the FPC and Lazarus sources as described above. If you need to rebuild Lazarus or want to help with its development, then you should to install the Lazarus source to a folder where you have read-write permission, as described above.

Now you can start Lazarus by choosing Applications | Lazarus.

Additional experiences and advice on installing FPC and Lazarus

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.