|Lazarus – An IDE for Free Pascal
When searching for information on the Free Pascal Compiler (FPC), I
found that most of the hits related to Lazarus, an integrated
development environment (IDE) for FPC.
While the standard
version of FPC runs in a command window, Lazarus offers a modern,
graphical user interface, with multiple display windows for a variety
The program is
readily downloaded and installed from a single distribution file (I
used lazarus-182-fpc-304-win64.exe, the 64-bit version) which
installs both FPC and the Lazarus IDE.
By default, Lazarus
opens a number of windows, including a source editor, form manager,
and an object inspector. For simple programming, we don’t need the
form manager or the object inspector so both of these windows can be
Using Lazarus is not particularly intuitive. For example, clearing
the source editor window, loading our hello.pas source code (see the
previous article in this series, A Free Pascal
Compiler), and compiling the code,
immediately generates a fatal error – Can’t find unit1 used by
Project1. Perhaps we shouldn’t have cleared the “unit1” code
from the source editor!
there are some very good on-line tutorials on how to use Lazarus.
For example, Lazarus
Pascal Programming Tutorials - Tutorial 1 - Getting Started
shows how to use File – New – Program to create a program
template. We simply add the writeln ('Hello world'); and readln;
commands between the already-established begin and end lines of code.
We can compile the program using Run – Compile
and the message window will now indicate “Success”.
Alternatively, we can use the run icon (the forward-arrow) on the
menu ribbon which will both compile the code and run the executable
program that is automatically created. This process also opens a
command window in which the program’s output – “Hello world”
– is displayed.
So, Lazarus is (at
least) one step up from using FPC in its default environment. In the
next article in this series, we will see if we can use the IDE to
breathe new life into an old Turbo Pascal program.
Lazarus (Open Source)
published: February 2019
top of page