Now I’m on Windows 11 trying to re-compile the editor (version 7.0-alpha3.snapshot) with custom components but it ends with this error (and a few related more):
C:\prog\motores\CastleGameEngine\tools\common-code\toolmanifest.pas(144,29) Error: (5000) Identifier not found “TProjectDependencies”
I’m using FPC 3.2.2 and Lazarus 3.4. On Linux I’m using FPC 3.2.0 and Lazarus 3.4 and it compiles without error but a few warnings.
I was about to upgrade Lazarus but the site is down right now.
Hm, you generally do not need to uninstall previous engine version if you “update in place”. Our Windows installer (if you download binaries from Download | Castle Game Engine ) has been specifically tested to ensure smooth upgrades (without the need to uninstall old version first).
Maybe there’s something we should fix – can you describe in more details
how did you install CGE originally? I can see that old version (known to Lazarus) is in C:\prog\motores\CastleGameEngine .
how did you update CGE?
Your messages did indicate you had 2 versions of CGE sources, one old (C:\prog\motores\CastleGameEngine) and one new.
( I understand you solved the issue anyway on your system. But in any case more info would be appreciated – we want to ensure “smooth upgrades” for people, without the need to uninstall. So if there’s some bug there, I’d like to fix it )
I think the issue was that the first time I installed CGE I didn’t use the Windows installer, I just downloaded a zip and uncompressed it (iirc). Using the installer from the first install should allow clean updates, but Michalis would confirm that.
Yes, using the installer (i.e. exe on Windows) to install the new version should behave OK, and it will update from previous version smoothly (correctly removing or replacing all files from the old version). InnoSetup that we use guarantees it, I checked it long time ago.
If you installed the previous version from zip/tar.gz, then installer doesn’t know about it, there is no central information about it. So installer cannot remove/replace it, and it’s your responsibility to remove it manually before using the new version. Some people may also use this way (installing from zip) like to keep multiple engine versions installed in parallel, with the obvious caveat that you need to be aware always which one do you use, and make sure all IDEs/environment variables ($PATH, Lazarus, Delphi, VS Code config) point to the same CGE version, and not have a “mix” .
In one of the projects it compiles the game, but it doesn’t find unit CastleWindows when compilling the CGE Editor. The unit is referenced in one of the views (to close the application when pressing Esc).
The weird thing is that another (newer) project it compiles both without any problem and it also uses unit CastleWindows.
Hm, I’m not sure what happens, we need more information what/how you’re doing
We have no unit named CastleWindows. Only CastleWindow. I guess you mean CastleWindow.
But the CGE editor doesn’t use CastleWindow. CGE editor also doesn’t have any views.
And it’s not clear how do you build the editor, how it fails.
Please show exactly the error message. Best to make screenshots of what you’re doing, or record a short movie.
And show where do you have Castle Game Engine installed (in the explorer), and show whether you configured the “Castle Game Engine Path” in “Preferences → General” and did you set $CASTLE_ENGINE_PATH.
CGE is installed in C:\prog\motores\Castle Game Engine, using windows Installer, and it’s correctly auto-detected by CGE, as shown in “Preferences → General”. As far as I can see, $CASTLE_ENGINE_PATH isn’t set.
Hello, Did you register the components in Lazarus?. Did you compile the CGE packed from Lazarus?. I use “most_important_lazarus_packages_and_tools.lpg” project group?
/BlueIcaro
Hm, “PPU is compiled for another processor” points to something weird happening with CPU. Maybe compiler artifacts for Win32 (i386) and Win64 (x86_64) got mixed. I’m not sure why does it seem like it tries to compile for i386 – editor is x86_64 and should compile for x86_64.
It seems you installed FPC and Lazarus independently, in c:/lazarus/fpc/3.2.2/, maybe it doesn’t have the Win64 installed?
Ideas:
Can you change the “Preferences → FPC and Lazarus” to use “bundled FPC” installed along with CGE? Just delete the custom FPC path there. The FPC we provide can build Win64 applications.
Sorry for the silence but I was not working in this issue because I had to move forward, and it wasn’t critical since Linux (which is my main platform) worked without problems.
Until now.
I was learning about Android development and suddently, after installing the cross-platform compiler using fpcupdeluxe, the Editor doesn’t compile anymore and has the exact same error, except it doesn’t include the “PPU is compiled for another processor” message.
I’ve found a workaround: remove the GameViewWindow unit from the uses, add the CustApp unit and replace Application by CustomApplication. Then, on the dpr code, add also CustApp and the line CustomApplication := Application just before Application.OpenAndRun.
The lack of “PPU is compiled for another processor” may mean it’s a different error. (I am not sure, I would have to see exact code and environment of everything :), but at least in this case the error is clear. )
looks that not only the flow for editor component(s) is using CastleWindow (which is traceable from error log, where units get compiled in order of appearance in uses clause and recursively compiling sub-dependent units) , rather editor component depends on player, which in turn depends on view, and view depends on CastleWindow , the latter is actually ok, but editor component should not depend on internals (dependency-inversion violation), it should be isolated in general, and for the functionality you would probably need to pass params to constructor or smth like this. Player is also weirdly depending on view, should be vice versa.
The project was made for a Jam, so no planification was done. At a moment I decided to change a class in to a behavior. That class referenced two of the views, but when transforming it in to a behavior I moved that code to another place more suitable for it. The problem was I forgot to remove the view references from the USES section. Once removed it compiled and behaved as it should.
So guys, plan your code organization as much as you can before to start to code, even if it’s a prototype or a fast Jam entry.