Castle_base and castle_window problems with Lazarus

Good day!

I found some time for back to my CGE project, but face some difficulties with depends (as i understand).

I install Lazarus 4.0 from Debian 13 repository (4.6 from lazarus-ide.org works same) and download fresh CGE version. I register Lazarus packages in CGE editor and try to run some examples and my projects, but get 256 error in CGE.

I try to run dame projects form IDE, bot Lazarus don’t found castle_base and castle_window. Project inspector suggest me install it from the internet, but it not helps: Lazarus cant compile any project, usually with old error castleutils_struct_list.inc(27,12) Error: Duplicate identifier “PT”.

Moreover, same error in the LMDE (6-7).

It seems you’re trying to use a really ancient Castle Game Engine 6.4 version, which results in error Error: Duplicate identifier “PT” – this comes from change in latest FPC versions, for which the engine 6.4 is not ready.

This possibly happened because you used OPM (Online Package Manager) to install CGE, which indeed includes now engine version 6.4 (confirmed by looking at https://packages.lazarus-ide.org/ , it shows CGE version 6.4). We really, really should contact OPM managers to update Castle Game Engine definition there, so that OPM links to latest engine version:

I realize that our “funny” version number, “7.0-alpha.3”, doesn’t help in our communication :slight_smile: Despite the “alpha” word in version name, it is the closest thing we have to “latest stable release”, and definitely more recommended than ancient 6.4. See also my recent answer about it in this thread. Any help with this is most welcome – if anyone wants to take care of updating OPM definition to link to latest stable, I’ll appreciate it. You can link to this forum post, and to that one, and of course I’m happy to help.

The trivial solution right now: Don’t use CGE from OPM. Download Castle Game Engine from our downloads. Use “Register Lazarus Packages” button as documented here: Lazarus | Manual | Castle Game Engine . And make sure you don’t have any leftover old engine versions on disk, to not confuse you :slight_smile: Building examples using Lazarus should work flawlessly then (it is automatically checked, so I’m certain it works :slight_smile: ). Note that even package names have changed, we have packages like castle_engine_base, castle_engine_window (not castle_base, castle_window), see here for announcement.

Thanks! But I think i use new CGE. Problem may be deeper? :thinking:

  1. I download CGE from this cite “downloads” page (so it 7.0 version),

  2. Tap on the IDE registration button (in castle_editor, and it happened successfully) and, after that, run trying to compile. However, Lazarus project inspector complain at depends of castle_base and castle_window.

Far before I had “PT error” but, as I remember, it was solved easily - that time I just forget about Lazarus packages registration - but now I take it into account :upside_down_face:
If I understand, Lazarus try to find old packages what really not neded more for now?

Few minutes ago I repeated all on the my workplace laptop. And… all works perfect. I see two differences:

  1. Here I have older Lazarus 3.8
  2. And previous Debian version

At evening i will totally purge all new Lazarus packages from my PC, install rare version and show you results.

Also, any Lazarus knows about 6.93.1 castle_base (look at screenshot)

I think the problem was with GTK3.

I installed it, and projects started compiling (I was little surprised, because I use xfce, and this DE based on the GTK, as I know).

And finally this packages if fine!

(I change they manually in my older project)

I’m happy it is solved now on your side!

For what it’s worth, I think above you were touched by a few independent issues – so that may make things seem confusing :slight_smile:

  1. The error about Error: Duplicate identifier “PT” – that came from engine 6.4.

  2. The usage of castle_base/window (not castle_engine_base/window) packages – that came from engine snapshot before August 2025. Our new packages castle_engine_base/window have a section “provides” so that they can also satisfy old dependencies, but maybe it doesn’t work in some setups.

    • Maybe it could also cause confusion if your Lazarus “knows” new and old package names installed, so you had both old and new CGE versions registered? But now I’m speculating / guessing. To properly debug all issues above, I would like access to your system to investigate, but I guess it doesn’t matter anymore as you solved it :slight_smile:
  3. The need to have GTK 3 installed is also independent, it’s since February 2026. On Debian-based systems, one needs to do libgtk-3-dev. Full list of libraries we recommend installing on Linux is here.

I know – I’m not making it easier by relying so much on “snapshot” releases, instead of having proper new CGE releases regularly (and having them also updated in OPM). We should try better with releases:)

1 Like

I think I encountered both independent problems, because don’t watched current updating news.

Try to compile old project (old depends), got error → Try engine example → got GTK error.

Also Lazarus 4+ have another problems, so I was totally confused :distorted_face:
But now all in it’s places, thanks!

1 Like