Difference between revisions of "Installing Lazarus"

From Free Pascal wiki
Jump to navigationJump to search
(merge redundant windows sections)
(→‎Operating system specific guides: More molding and de-duping of Windows installation instructions)
Line 31: Line 31:
 
== Operating system specific guides ==
 
== Operating system specific guides ==
  
* Remember that Free Pascal Compiler and Lazarus are separate products, you almost certainly need to install FPC, FPC Source and Lazarus (maybe in that order !).
+
* Remember that the Free Pascal Compiler and the Lazarus IDE are separate products, you almost certainly need to install FPC, FPC Source and Lazarus (maybe in that order!).
 
 
* Some people recommended to use the [[fpcup|fpcUP]] updater-installer for first time users of Lazarus, which installs Free Pascal and Lazarus in one go into a single subdirectory structure ( ~/development ).  
 
  
 +
* Some people recommended using the [[fpcup|fpcUP]] updater-installer for first time users of Lazarus, which installs Free Pascal and Lazarus in one go into a single subdirectory structure ( ~/development ).
  
 
=== FreeBSD ===
 
=== FreeBSD ===
Line 46: Line 45:
 
=== Linux ===
 
=== Linux ===
  
 +
'''See [[Installing Lazarus on Linux]] which covers most of what you need for most Linux Distributions.'''
  
'''See [[Installing Lazarus on Linux]] - this page covers most of what you need for most Linux Distributions.'''
+
* The command to start Lazarus from a console is [[startlazarus]]. If you installed it from a Debian package, you should have a Lazarus menu entry under Application/Programming.
 +
* Issue: there is an ambiguity with a program also called "lazarus" from a <tt>tct</tt> package available for Ubuntu.
 +
* For a fully working Lazarus installation, older versions of the FPC compiler, FPC source or Lazarus can be a problem if present.
 +
* Some people recommended using [[fpcup|fpcUP]] updater-installer for first time users of Lazarus, which installs Free Pascal and Lazarus in one go into a single subdirectory structure (~/development).  
  
* Note, the command to start Lazarus from a console is [[startlazarus]]. If you installed it from a Debian package, you should have a Lazarus menu entry under Application/Programming.
+
Some distribution specific pages exist, but they may not be as up to date as the [[Installing Lazarus on Linux]] guide.
* Issue: there is an ambiguity with a program also called "lazarus" from a "tct" package available for Ubuntu).
 
* Note that for a fully working Lazarus install, older versions of fpc compiler, fpc source or Lazarus can be a problem if present.
 
* Some people recommended the use the [[fpcup|fpcUP]] updater-installer for first time users of Lazarus, which installs Free Pascal and Lazarus in one go into a single subdirectory structure ( ~/development ).
 
 
 
Some distribution specific pages exist, they may not be as up to date as the [[Installing Lazarus on Linux]] page.
 
  
 
* [[Install on aarch64 Arch or Manjaro]]
 
* [[Install on aarch64 Arch or Manjaro]]
* [[Install_on_Fedora|Install on Fedora]]
+
* [[Install on Fedora]]
 
* [[Scientific Linux]]
 
* [[Scientific Linux]]
  
 
'''Ubuntu/Debian Linux notes'''
 
'''Ubuntu/Debian Linux notes'''
 +
 
* The Debian Testing Repository, unlike Ubuntu Releases, often contains a current or near current version of FPC and Lazarus. Feedback is needed and appreciated; please send your comments to Carlos Laviola <claviola@debian.org>
 
* The Debian Testing Repository, unlike Ubuntu Releases, often contains a current or near current version of FPC and Lazarus. Feedback is needed and appreciated; please send your comments to Carlos Laviola <claviola@debian.org>
 
* Building debs the easy way - A possible way to get a current working installation of Lazarus is to download and build your own .deb packages by following the instructions at [[How to setup a FPC and Lazarus Ubuntu repository]]
 
* Building debs the easy way - A possible way to get a current working installation of Lazarus is to download and build your own .deb packages by following the instructions at [[How to setup a FPC and Lazarus Ubuntu repository]]
Line 74: Line 73:
 
=== Windows ===
 
=== Windows ===
  
By far the easiest and most common way to install Lazarus on windows is to go to the Lazarus SourceForge download site, https://sourceforge.net/projects/lazarus/files/ select an appropriate combined FPC/Lazarus installation package, download and install.
+
==== Using the Windows Installer ====
  
 +
By far the easiest and most common way to install Lazarus on Windows is to go to the official [https://sourceforge.net/projects/lazarus/files/ Lazarus SourceForge download site] select an appropriate combined FPC/Lazarus installation package, download the latest release and launch the installer.
  
For more specific cases, see the next section -
+
The current releases of the Windows Lazarus installer packages install very easily, and should work 'out-of-the-box'. Upgrading is as simple as downloading the new installer and running it. You will be taken through a typical Windows installation wizard to install the FPC compiler and FPC source within the same directory structure as Lazarus IDE, and Lazarus 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]].
  
The current releases of the Windows Lazarus binary packages install very easily, and should work 'out-of-the-box'. Upgrading is as simple as downloading the new installer and running it.  
+
Tip: It's perhaps a good idea to reboot your Windows system after you have installed Lazarus and before you try to install additional Lazarus components such as zeoslib for example.
  
Win98 and WinME need a special flag to compile. You need to use make OPT="-dWIN9XPLATFORM" otherwise the lazarus.exe will not be able to run on these operating systems.
+
==== Installing Lazarus on a Portable USB Drive ====
  
'''Installing Lazarus on Portable USB Drive'''
+
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 <tt>fpc.cfg</tt> file.  It may also be necessary to keep the directory for test compilation on your portable drive.
  
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?
  
<< 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:
  
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:
 
 
<syntaxhighlight lang="dos">set THUMBDRIVE=%CD:~0,2%</syntaxhighlight>
 
<syntaxhighlight lang="dos">set THUMBDRIVE=%CD:~0,2%</syntaxhighlight>
 +
 
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:
 
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:
 +
 
<syntaxhighlight lang="dos">%SystemRoot%\system32\cmd.exe /k bin\setenv</syntaxhighlight>
 
<syntaxhighlight lang="dos">%SystemRoot%\system32\cmd.exe /k bin\setenv</syntaxhighlight>
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 [http://sed.sf.net 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):
+
so that when I click on that link when the thumb drive folder is displayed after inserting it, it will open a command prompt at the thumb drive with the environment variables set from <tt>setenv.bat</tt>.
 +
 
 +
Also inside the bin directory is [http://sed.sf.net sed] (the actual binary is one I obtained from the mingw distribution). So I created another batch file called <tt>fixlaz.bat</tt> 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 <tt>fixlaz.bat</tt>, not the current one of your USB drive which <tt>fixlaz.bat</tt> 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 <tt>editoroptions.xml</tt> and <tt>fpc.cfg</tt> files (<tt>fpc.cfg</tt> is in the fpc bin directory, which might be buried deep in the lazarus folder):
  
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
Line 107: Line 110:
 
<syntaxhighlight lang="dos">fixlaz G:</syntaxhighlight>
 
<syntaxhighlight lang="dos">fixlaz G:</syntaxhighlight>
  
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.
+
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 <tt>setenv.bat</tt>). 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
+
==== From source on Windows using svn on the command line ====
  
Download the latest release 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).
+
Please note these instructions are for SubVersion, but there is also a Git mirror repository of Free Pascal Compiler and Lazarus. See [[git mirrors|Git mirror]] for details. You can also use git directly with SubVersion server using git-svn link. See  [[Lazarus git-svn|Lazarus git-svn]] for details.
 
 
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 system after you have installed Lazarus and before you try to install additional Lazarus components such as zeoslib for example.
 
 
 
==== From source on Windows ====
 
  
If you prefer to install from sources, then follow these instructions.
+
Open a command prompt window. Start->Run...>CMD or choose the MS-DOS icon. You will use this window to enter the commands below.
  
Please note these instructions are for SubVersion, but there is also a Git mirror repository of Free Pascal Compiler and Lazarus. See [[git mirrors|Git mirror]] for details. You can also use git directly with SubVersion server using git-svn link. See  [[Lazarus git-svn|Lazarus git-svn]] for details.
+
You have to download the Lazarus source from one of the [[Lazarus Snapshots Downloads|snapshot servers]]. Then unzip it to <tt>c:\lazarus</tt> for example [below called <tt>$(LazarusDir)</tt>].
  
Open a command prompt window. Start->Run...>CMD or choose MS-DOS icon. You will use this window to enter the commands below
+
Or you can use SVN (example for text mode SVN):
  
You have to download the lazarus source from one of the [[Lazarus Snapshots Downloads|snapshots servers]].
 
Then unzip it to c:\lazarus for example [below called $(LazarusDir)].
 
 
Or you use SVN (example for text mode SVN; adapt to GUI tools such as TortoiseSVN if you want to):
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
mkdir c:\lazarus
 
mkdir c:\lazarus
 
cd /d c:\lazarus
 
cd /d c:\lazarus
svn checkout http://svn.freepascal.org/svn/lazarus/trunk/ c:\lazarus
+
svn checkout https://svn.freepascal.org/svn/lazarus/trunk/ c:\lazarus
 
</syntaxhighlight>
 
</syntaxhighlight>
  
You have to install at least the latests stable FPC version (e.g. FPC 3.0.4, but an FPC 3.1.1 snapshot is also possible).  
+
You have to install at least the latest stable FPC version (eg FPC 3.2.0 as at Jan 2021).  
 +
 
 +
Type (replace "YourLazarusDir" with the path you have unzipped/checked out Lazarus; replace:
  
Type (replace "YourLazarusDir" with the path you have unzipped/checked out Lazarus; replace
 
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
 
cd "YourLazarusDir"
 
cd "YourLazarusDir"
Line 147: Line 140:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
*Win9x/WinME: use make OPT="-dWIN9XPLATFORM" otherwise the lazarus.exe will not be able to run on this platform.
+
* Windows 98 and Windows ME need a special flag to compile. You need to use make <tt>OPT="-dWIN9XPLATFORM"</tt> otherwise the lazarus.exe will not be able to run on these operating systems.
  
If this works, you can type: lazarus.exe.  
+
If you have followed this successfully, you can now type: <tt>lazarus.exe</tt> which should start the Lazarus IDE.  
  
You can compile examples also:
+
You can also compile the examples:
  
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
Line 158: Line 151:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
'''Installing from source starting with a stable release'''
+
==== From source on Windows using the GUI Tortoise SVN ====
 
 
An alternative version of the instructions above.
 
  
1> First of all install the latest stable Lazarus to obtain a good starting FPC, for example in C:\lazarus_1_4
+
1> First of all install the latest stable Lazarus to obtain a good starting FPC, for example in <tt>C:\lazarus_2_0_10</tt>.
  
2> Now use TortoiseSVN to checkout http://svn.freepascal.org/svn/lazarus/trunk/ into c:\lazarus
+
2> Now use TortoiseSVN to checkout <tt>http://svn.freepascal.org/svn/lazarus/trunk/ into c:\lazarus</tt>
  
3> Make the following C:\lazarus\build.bat file:
+
3> Make the following <tt>C:\lazarus\build.bat</tt> batch file:
  
Replace $(LazarusDir) with your Lazarus did and make sure the FPC version number matches
+
Replace <tt>$(LazarusDir)</tt> with your Lazarus directory and make sure the FPC version number matches
  
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
SET PATH=$(LazarusDir)\fpc\2.6.4\bin\i386-win32\
+
SET PATH=$(LazarusDir)\fpc\3.2.0\bin\i386-win32\
 
make bigide
 
make bigide
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Now create a shortcut in your desktop to start Lazarus and put the following command to start Lazarus which will make sure that it separates the config files from the stable and the SVN versions:
+
Now create a shortcut on your desktop to start Lazarus and put the following command to start Lazarus which will make sure that it separates the config files from the stable and the SVN versions:
  
 
<syntaxhighlight lang="dos">$(LazarusDir)\startlazarus.exe --pcp=$(LazarusDir)\configdir </syntaxhighlight>
 
<syntaxhighlight lang="dos">$(LazarusDir)\startlazarus.exe --pcp=$(LazarusDir)\configdir </syntaxhighlight>
  
Always start Lazarus from this shortcut, never directly from the executable. At the first time you start Lazarus configure you FPC dir, FPC sources dir and Lazarus dir.
+
Always start Lazarus from this shortcut, never directly from the executable. The first time you start Lazarus configure your FPC dir, FPC source directory and Lazarus directory.
  
 
'''Building Lazarus on Win98 and WinME'''
 
'''Building Lazarus on Win98 and WinME'''
  
Because the Lazarus IDE by default links to a dll-call "CreateToolhelp32Snapshot", which does not exist on the Win9x platform, the IDE will not run on Win9x out of the box. In order to make it run you have to rebuild the IDE with make "-dWIN9XPLATFORM".
+
Because the Lazarus IDE by default links to a dll-call "CreateToolhelp32Snapshot", which does not exist on the Win9x platform, the IDE will not run on Win9x out of the box. In order to make it run you have to rebuild the IDE with <tt>make -dWIN9XPLATFORM bigide</tt>.
  
 
== What does the ''bigide'' make argument do? ==
 
== What does the ''bigide'' make argument do? ==

Revision as of 06:10, 17 January 2021

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)

Overview

A real "in depth" build guide is here.

For binary downloads of Lazarus see Download and install Lazarus release version.

For people who simply want to install Lazarus and start using it for programming, the easiest approach is to download and install a recent, reasonably stable binary release (such as a Linux ".rpm" package, a Windows ".exe" installer, or a macOS ".dmg" disk image or installer ".pkg" package). You can read the sections under Linux or Windows entitled "fpc binaries" or the first paragraphs in the sections on installing Lazarus in Linux or Windows; most of the remaining information can be safely ignored.

For those who want to participate in the development of the compiler or the IDE, or for those who want the most up-to-date tools, an installation from source files is necessary, and much of the rest of this information is relevant.

Lazarus provides two main parts:

  • LCL - the Lazarus Component Library
  • IDE - the RAD tool

These in turn are dependent on:

  • FPC - the Free Pascal compiler
  • FCL - the Free Pascal Component library, containing most of the non-graphic components used by Lazarus

Lazarus system requirements

  1. A Free Pascal Compiler, packages, and sources. (*Important*: of the same version/date)
  2. A supported widget set:
    Win32/Win64
    The native Win32 API can be used, or the Qt widgetset.
    Linux/BSD
    GTK+ 2.x or Qt : Most Linux distributions and *BSDs already install the GTK+ 2.x libraries. You can also find them at http://www.gtk.org.
    Qt is also supported with all distributions (auto installed if you prefer KDE).
    macOS
    You need the Apple Xcode developer tools. For macOS versions before 10.15 (Catalina), the 32 bit Carbon or 64 bit Cocoa widget sets can be used.
    For macOS 10.15 onwards, the 64 bit Cocoa widget set must be used as all 32 bit support has been removed by Apple.
    Qt can be used too, but it requires much more effort.
The Qt widget set is supported on Linux 32/64, Win 32/64, macOS 32/64, FreeBSD 32/64, Haiku and embedded Linux (qtopia) platforms. For more details about the installation of Qt, see the Qt Interface article.

Operating system specific guides

  • Remember that the Free Pascal Compiler and the Lazarus IDE are separate products, you almost certainly need to install FPC, FPC Source and Lazarus (maybe in that order!).
  • Some people recommended using the fpcUP updater-installer for first time users of Lazarus, which installs Free Pascal and Lazarus in one go into a single subdirectory structure ( ~/development ).

FreeBSD

Haiku

Linux

See Installing Lazarus on Linux which covers most of what you need for most Linux Distributions.

  • The command to start Lazarus from a console is startlazarus. If you installed it from a Debian package, you should have a Lazarus menu entry under Application/Programming.
  • Issue: there is an ambiguity with a program also called "lazarus" from a tct package available for Ubuntu.
  • For a fully working Lazarus installation, older versions of the FPC compiler, FPC source or Lazarus can be a problem if present.
  • Some people recommended using fpcUP updater-installer for first time users of Lazarus, which installs Free Pascal and Lazarus in one go into a single subdirectory structure (~/development).

Some distribution specific pages exist, but they may not be as up to date as the Installing Lazarus on Linux guide.

Ubuntu/Debian Linux notes

  • The Debian Testing Repository, unlike Ubuntu Releases, often contains a current or near current version of FPC and Lazarus. Feedback is needed and appreciated; please send your comments to Carlos Laviola <claviola@debian.org>
  • Building debs the easy way - A possible way to get a current working installation of Lazarus is to download and build your own .deb packages by following the instructions at How to setup a FPC and Lazarus Ubuntu repository

macOS

Raspbian

Windows

Using the Windows Installer

By far the easiest and most common way to install Lazarus on Windows is to go to the official Lazarus SourceForge download site select an appropriate combined FPC/Lazarus installation package, download the latest release and launch the installer.

The current releases of the Windows Lazarus installer packages install very easily, and should work 'out-of-the-box'. Upgrading is as simple as downloading the new installer and running it. You will be taken through a typical Windows installation wizard to install the FPC compiler and FPC source within the same directory structure as Lazarus IDE, and Lazarus 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 system after you have installed Lazarus and before you try to install additional Lazarus components such as zeoslib for example.

Installing Lazarus on a Portable USB Drive

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 displayed 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 in 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.

From source on Windows using svn on the command line

Please note these instructions are for SubVersion, but there is also a Git mirror repository of Free Pascal Compiler and Lazarus. See Git mirror for details. You can also use git directly with SubVersion server using git-svn link. See Lazarus git-svn for details.

Open a command prompt window. Start->Run...>CMD or choose the MS-DOS icon. You will use this window to enter the commands below.

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

Or you can use SVN (example for text mode SVN):

mkdir c:\lazarus
cd /d c:\lazarus
svn checkout https://svn.freepascal.org/svn/lazarus/trunk/ c:\lazarus

You have to install at least the latest stable FPC version (eg FPC 3.2.0 as at Jan 2021).

Type (replace "YourLazarusDir" with the path you have unzipped/checked out Lazarus; replace:

cd "YourLazarusDir"
rem Of course change the first path variable to
rem the path of your FPC compiler
set path=c:\freepascal\bin\x86_64-win64;%PATH%
make
  • Windows 98 and Windows ME need a special flag to compile. You need to use make OPT="-dWIN9XPLATFORM" otherwise the lazarus.exe will not be able to run on these operating systems.

If you have followed this successfully, you can now type: lazarus.exe which should start the Lazarus IDE.

You can also compile the examples:

cd "YourLazarusDir"\examples
make

From source on Windows using the GUI Tortoise SVN

1> First of all install the latest stable Lazarus to obtain a good starting FPC, for example in C:\lazarus_2_0_10.

2> Now use TortoiseSVN to checkout http://svn.freepascal.org/svn/lazarus/trunk/ into c:\lazarus

3> Make the following C:\lazarus\build.bat batch file:

Replace $(LazarusDir) with your Lazarus directory and make sure the FPC version number matches

SET PATH=$(LazarusDir)\fpc\3.2.0\bin\i386-win32\
make bigide

Now create a shortcut on your desktop to start Lazarus and put the following command to start Lazarus which will make sure that it separates the config files from the stable and the SVN versions:

$(LazarusDir)\startlazarus.exe --pcp=$(LazarusDir)\configdir

Always start Lazarus from this shortcut, never directly from the executable. The first time you start Lazarus configure your FPC dir, FPC source directory and Lazarus directory.

Building Lazarus on Win98 and WinME

Because the Lazarus IDE by default links to a dll-call "CreateToolhelp32Snapshot", which does not exist on the Win9x platform, the IDE will not run on Win9x out of the box. In order to make it run you have to rebuild the IDE with make -dWIN9XPLATFORM bigide.

What does the bigide make argument do?

The bigide make argument adds a bunch of packages to Lazarus that many find useful and cannot do without. The packages that are added are:

  • cairocanvas
  • chmhelp
  • datetimectrls
  • externhelp
  • fpcunit
  • fpdebug
  • instantfpc
  • jcf2
  • lazcontrols
  • lazdebuggers
  • lclextensions
  • leakview
  • macroscript
  • memds
  • onlinepackagemanager
  • pas2js
  • PascalScript
  • printers
  • projecttemplates
  • rtticontrols
  • sdf
  • sqldb
  • synedit
  • tachart
  • tdbf
  • todolist
  • turbopower_ipro
  • virtualtreeview

The above list is sourced from the [Lazarus source directory]/IDE/Makefile.fpc and may be subject to change.

Note that if you have not compiled your own Lazarus IDE with the bigide argument, you can install any of these packages yourself using the Lazarus IDE Package > Install/Uninstall Packages... dialog.

Multiple Lazarus installs

Please see Multiple Lazarus for details on having more than one Lazarus version installed on one system. We cover issues that can arise due to multiple Lazarus installs here, because they can also happen when installing over a previous version.

Troubleshooting

Troubleshooting details that should (hopefully) be applicable across platforms may be found in the article Installation Troubleshooting.

Lazarus FAQ

The Lazarus FAQ - Frequently Asked Questions - page is available here.

Installing old versions

See Installation hints for old versions

See also