Supported compilers and IDEs

Castle Game Engine icon

1. FPC and Lazarus

1.1. FPC version

FPC (Free Pascal Compiler) is a Pascal compiler. You need a compiler, either FPC or Delphi, to build Castle Game Engine applications.

Our official downloads for Windows and Linux already include the most recommended (latest stable) FPC version, so you don't need to install FPC yourself. On other platforms, you need to install FPC yourself. Some of the options are:

We always support and advice the latest stable release of FPC: right now this means 3.2.2.

Usually, we also support a couple of older FPC releases. Right now we support any FPC version >= 3.2.0.

Explanation and history: We use some modern Pascal features (like generics) in CGE, so we occasionally bump the required FPC version. We check what is commonly available, e.g. what is in the latest Debian stable (which is a baseline for many other Linux distros).

Special note if you want to build for Aarch64 (64-bit Arm), as found on Android, iOS, macOS: While we support any FPC >= 3.2.0, we strongly advise FPC >= 3.2.2. That is because certain optimizations have been broken in older FPC versions. Our build tool disables optimizations in released builds when it detects Aarch64 and older FPC.

1.2. Lazarus version

Lazarus is an IDE (editor, debugger etc.) built around FPC. It also features a visual classes library (LCL) and an associated form designer.

Strictly speaking, you don't need Lazarus to use Castle Game Engine. You can use any editor to write Pascal code (e.g. VS Code) and compile your games using the engine editor and build tool which under the hood just call FPC (or Delphi) command-line compilers.

That said, of course you can use Lazarus with CGE, it's a feature-packed cross-platform comfortable IDE made for Pascal. Moreover, you need Lazarus if you want to

  1. Put TCastleControl on a Lazarus form (LCL),

  2. Compile CGE editor from sources or

  3. Create custom components available at design-time, in an editor version special to the given project.

As for Lazarus version:

  • On Windows: We recommend Lazarus >= 3.2.

    Older Lazarus versions have known issues:

    • Versions before 2.2 don't have this fix which allows more intuitive behavior when you double-click on a Pascal file in CGE editor to open Lazarus.

    • Versions before 3.0 will not compile pasls (miss IdentComplIncludeKeywords).

  • On macOS, Linux, FreeBSD: We recommend Lazarus >= 3.5.

    This means you should use Lazarus fixes_3_0 or main branch from GitLab. It is easiest to use Lazarus from a branch using FpcUpDeluxe.

    Unfortunately, last stable Lazarus 3.4 has 2 important bugs that affect CGE editor:

    Our Docker images right now include Lazarus versions with this issue patched by this diff.

1.3. We recommend FpcUpDeluxe

To install multiple versions of FPC / Lazarus, with cross-compilers (e.g. for Android or iOS), use FpcUpDeluxe! We absolutely recommend and support it.

1.4. If you use sparta_Docked package

Some FPC libraries, like sparta_Docked or sparta_Generics, may contain their own copy of Generics.Collections unit and friends.

FPC >= 3.2.0 doesn't need them (it contains the Generics.Collections and friends, with the same implementation from Maciej Izak). In case of CGE, we didn't need them even for FPC 3.0.x, and CGE included our own copy of Generics.Collections.

Solution: Remove Generics.Collections and related units from any sparta_xxx or other packages. FPC includes them already. Report to authors of these packages that these units create conflicts with FPC >= 3.2.0 standard units.

1.5. If you use FPC development version (from GitLab)

We generally try to support using the latest (unstable) FPC development version to compile CGE.

You can get such FPC:

Of course please remember that this FPC version is unstable, and it changes with every commit to FPC. We cannot test or guarantee that CGE works with an arbitray FPC development revision. But we welcome testing such FPC. PRs to make CGE work with latest FPC trunk are also welcome (unless there's a temporary bug in FPC which should be rather reported to FPC devs).

2. Delphi

We moved our Delphi documentation to a separate page.

3. Code Typhon

We do not support using Code Typhon (a fork of FPC/Lazarus).

We advise that you rather use original FPC and Lazarus. We have more trust in FPC and Lazarus developers doing great quality job, respecting copyrights of other projects (CodeTyphon did some murky things), and working in a transparent fashion (version control, cooperating with other projects).

Note that Lazarus comes now with Online Package Manager. And you can use FpcUpDeluxe to easily install cross-compilers. These cover the most often cited reasons for using Code Typhon in the past.