Tools & Environment Setup
2.1 Compilers and IDEs
License / Cost Free Pascal Compiler (FPC) command-line compiler + RTL + packages
Windows, Linux, macOS, FreeBSD, Android, embedded, and many CPUs free, open source Lazarus IDE
RAD IDE with form designer, LCL, debugger Windows, Linux, macOS, FreeBSD Delphi / RAD Studio commercial RAD IDE (Windows-hosted) targets Windows 32/64, macOS, iOS, Android, Linux 64 (edition-dependent)
Professional/Enterprise/Architect licenses Delphi Community Edition free edition of Delphi Professional free for individuals and small companies below a revenue limit (US $5,000/year at the time of writing) VS Code + extensions installer that builds FPC/Lazarus from source, adds cross-compilers Windows, Linux, macOS Online compilers
2.2 Installing Free Pascal and Lazarus
Windows: download the Lazarus installer (it bundles FPC) from lazarus-ide.org. Optionally install the cross-compiler add-on for Win32/Win64.
Linux: install the fpc and lazarus packages from your distribution (Debian/Ubuntu: sudo apt install fpc lazarus), or use the official .deb/.rpm packages for newer versions.
macOS: install Xcode command-line tools, then the FPC and Lazarus .pkg installers (or Homebrew: brew install fpc; Lazarus via its .pkg).
Check your installation:
fpc -iV # prints the compiler version, e.g. 3.2.2
fpc -i # lists supported targets and CPUs2.3 Delphi Community Edition
Register on embarcadero.com and download Delphi Community Edition.
Run the installer; choose target platforms (Windows is always included).
Activate with the serial number sent by e-mail (renewable annually).
Create a console application: *File → New → Console Application – Delphi*.
2.4 Visual Studio Code
code completion, navigation, Delphi and FPC support Pascal (Alessandro Fragnani) syntax highlighting, code navigation via ctags/GNU Global
Pascal Language Server (based on Lazarus CodeTools) LSP completion, go-to-definition for FPC DelphiLSP (Embarcadero) official Delphi language server (requires a Delphi installation) Native Debug / CodeLLDB debugging FPC programs with GDB or LLDB
A minimal VS Code task to build with FPC (.vscode/tasks.json):
{
"version": "2.0.0",
"tasks": [
{
"label": "fpc build",
"type": "shell",
"command": "fpc",
"args": ["-Mobjfpc", "-Sh", "-g", "-gl", "${file}"],
"group": { "kind": "build", "isDefault": true },
"problemMatcher": []
}
]
}2.5 Online compilers
OnlineGDB (Pascal), Ideone, Compiler Explorer (godbolt.org — shows FPC assembly output), JDoodle, and Replit-style sandboxes. Useful for quick experiments; use a local installation for real projects.
2.6 Common FPC command-line options
-Mobjfpc / -Mdelphi / -Mtp / -Miso {$H+} — string means AnsiString -O2 / -O3 / -O4 debug info, line info in stack traces link heaptrc (memory-leak report) -Cr -Co -Ci -Ct range, overflow, I/O, and stack checks unit search path include file search path -FE<dir> / -FU<dir> output directory for executable / units -T<os> -P<cpu> target OS and CPU (cross-compilation) verbosity: errors, warnings, notes, hints, info build all units define a conditional symbol