100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

Installing Free Pascal

How to install the Free Pascal compiler and the Lazarus IDE on your system and verify your setup with a test compile.

FoundationsBeginner7 min readJul 10, 2026
Analogies

Installing Free Pascal

Free Pascal (often abbreviated FPC) is a free, open-source compiler that implements the Pascal language across Windows, Linux, and macOS, and it is the compiler this course uses. You can install it either as a standalone command-line compiler or bundled with the Lazarus IDE, which adds a visual form designer and integrated debugger on top of FPC. For learning the language itself, the command-line compiler is enough; Lazarus becomes valuable once you start building windowed desktop applications.

🏏

Cricket analogy: Choosing between the standalone FPC compiler and the full Lazarus IDE is like choosing between practicing solo net sessions versus training at a full academy with coaches, both improve your game but Lazarus adds structured support the way a professional academy adds coaching.

Installing on Windows, macOS, and Linux

On Windows, download the FPC installer (or the combined Lazarus installer, which bundles FPC) from the official FPC or Lazarus website and run it; the installer adds fpc.exe and the necessary units to your system automatically. On macOS, you typically download the fpc-<version>.intelmac.dmg or fpc-<version>.macosx.dmg package (matching your chip architecture) and run the installer, then optionally install Lazarus separately. On Linux, most distributions provide FPC through their package manager, so on Debian or Ubuntu you would run 'sudo apt install fpc' and on Fedora 'sudo dnf install fpc', which is the fastest and most maintainable route since it integrates with your system's update mechanism.

🏏

Cricket analogy: Choosing the right installer for your OS is like choosing the right pitch report before a match, a green seamer wicket needs different preparation than a dry turning track, just as Windows needs a different installer than Linux's package manager.

Verifying Your Installation

After installing, open a terminal or command prompt and run 'fpc -iV' to print the installed compiler version, which confirms the compiler is on your system PATH. Then write a tiny test file, compile it with 'fpc hello.pas', and run the resulting executable to confirm the whole toolchain, editor, compiler, and OS, works together end to end. If 'fpc' is not recognized, the installer likely didn't add it to your PATH, and you'll need to add the FPC bin directory manually or re-run the installer with the PATH option enabled.

🏏

Cricket analogy: Running 'fpc -iV' before writing real code is like a bowler checking the ball's condition and seam before the first over, a quick sanity check before you commit to the actual match.

bash
# Check the installed Free Pascal compiler version
fpc -iV

# Compile a simple test program
fpc hello.pas

# Run the compiled executable (Linux/macOS)
./hello

# Run the compiled executable (Windows)
hello.exe

Lazarus is not a separate language, it is an IDE built on top of Free Pascal that adds a drag-and-drop visual form designer (similar in spirit to old Delphi or Visual Basic), an integrated debugger, and cross-platform project management, all while compiling the exact same Object Pascal code FPC compiles from the command line.

On Windows, if you install FPC without also installing Lazarus, some tutorials referencing a 'Lazarus IDE' menu won't apply to you, you'll be working purely from the command line or a text editor of your choice, which is perfectly fine for learning core language syntax.

  • Free Pascal (FPC) is the free, open-source compiler used throughout this course.
  • Lazarus is an optional IDE built on top of FPC with a visual designer and debugger.
  • Windows and macOS use downloadable installers; Linux distributions typically offer FPC via their package manager.
  • On macOS, choose the installer matching your chip architecture (Intel vs Apple Silicon).
  • Run 'fpc -iV' to confirm the compiler is installed and on your system PATH.
  • Always verify your setup by compiling and running a tiny test program before moving on.
  • PATH issues are the most common installation problem and are fixed by re-running the installer or editing environment variables.

Practice what you learned

Was this page helpful?

Topics covered

#Programming#PascalStudyNotes#InstallingFreePascal#Installing#Free#Pascal#Windows#StudyNotes#SkillVeris#ExamPrep