Castle Game Engine icon


Castle Game Engine is available on terms of GPL or LGPL (your choice):

  • You can use GNU General Public License (version 2 or above). See for more information about this license (including translations of it to various languages) and philosophy of free software.

  • Or you can use more permissive GNU Lesser General Public License (again version 2 or above) with the "static linking exception". The idea of this exception is to allow statically linking with the engine on the same terms as dynamically linking. Static linking is what usually happens when you compile a program using the engine units (without wrapping the engine in a dynamic library (dll, so, dylib) or Delphi runtime package).

    All this basically means that you can use the engine in closed-source programs, you only have to share your modifications to the engine units.

    The same license is used by FPC (Free Pascal Compiler) Runtime Library, Lazarus Component Library (LCL) and many other projects.

    The precise legal text of the "static linking exception" is this:

    As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.

    Note that if you want to use the engine on LGPL terms (as opposed to more strict GPL) you must compile the engine with CASTLE_ENGINE_LGPL symbol defined:

    • You can define it e.g. in file castle_game_engine/base/ Just put there {$define CASTLE_ENGINE_LGPL} line (or simply remove the beginning space in already prepared comment { $define CASTLE_ENGINE_LGPL}).
    • Or you can define CASTLE_ENGINE_LGPL in the compilation options of CGE Lazarus packages.
    • Or you can define CASTLE_ENGINE_LGPL in the compilation options in CastleEngineManifest.xml

    This is necessary to avoid pulling in GPL-only dependencies. For now, this is only the NURBS unit (uses GPL-only code from White_dune). This missing NURBS implementation is the only difference between LGPL and "strict GPL" engine version.

The tools and demos related to the Castle Game Engine, but available in a different repository than, and available only on terms of strict GPL license. This concerns e.g.