After updating CGE I get this error when I try to run from Lazarus.
This package cannot be found.
Compiling from CGE editor works fine (though lot of warnings).
Install the package from castle-engine\src\vampyre_imaginglib\src\Packages\VampyreImagingPackageExt.lpk
- However, I must agree that this is counterintuitive
still does not work.
What exactly doesnât work? It throws some error message? Now a new one or a different one? I see you didnât install the second package (it was asking if you want to install it too, but you seem to have answered ânoâ - though you should âyesâ)
Shouldnâit be installed automatically with castle base?
I donât think itâs straightfowrard if it isnât available in Lazarus installation. Especially as CGE requires a specific version of this package, at least for now
Looks strange, try build clean
maybe some leftovers from previous versions
Thanks. Ok, I just did that but it did not help, I get the same screen as above.
-
it better to paste text not pictures
-
it is better among other reasons for text quotes provide for instant select-and-google-for-quote
-
according to Google, abundancy of WSRegisterXXXX errors is - at least for LCL application for MS Windows - a telltale sign of
Interfaces
unit missing from the project main fileâs (program
, *.LPR or *.DPR)uses
clause.
I am not sure if you use Windows, or if non-LCL Castle applications would suffer the same, but try adding Interfaces
into the beginning of the LPR-file uses
list.
As for missing Vampyre⌠packages: see More integration with Vampyre Imaging Library, used by default with both FPC and Delphi â Castle Game Engine .
- You can install the
src/vampyre_imaginglib/src/Packages/VampyreImaginePackage.lpk
src/vampyre_imaginglib/src/Packages/VampyreImaginePackageExt.lpk
as Eugene pointed out.
-
But I would actually recommend using âPreferences â FPC and Lazarus â Register Lazarus Packagesâ button in CGE editor. After making sure that the Lazarus configured / detected by CGE editor is the one you actually use.
This follows our manual, Install | Manual | Castle Game Engine .
And it is also a more future-proof method. Whatever changes we ever make to packages and their dependencies, that button âPreferences â FPC and Lazarus â Register Lazarus Packagesâ is the easiest option to just register all necessary packages with Lazarus.
As for WSRegisterXXXX errors:
Please submit a testcase, i.e. a project that compiles that allows us to reproduce the problem. I do not experience it myself â just tested on Windows too, with latest CGE, both TCastleWindow-based and TCastleControl-based examples compile fine in Lazarus.
My blind guess is that your project mixes LCL with TCastleWindow, and it is causing problems. You can possibly workaround it by using Interfaces
unit, but in the end you should not do this. The program code you show refers to TCastleWindow, so you should not use anything from LCL. See Use engine inside Lazarus form using TCastleControl | Manual | Castle Game Engine .
But definitely it will be best if you submit a reproducible testcase, then we can debug definitely what is the problem
Personally i hit the interfaces
problem when converting simple Delphi/VCL applicaiton to FPC/LCL
It turned out the Lazarusâs project converter notoriously forgets to add the unit.
Point is - and it is my blind guess - could this somehow happen if GCE project was developed in Delphi first and only then somehow converted to Lazarus? Or would it even then only be possible if mixing self-hosted-CGE with LCL ?
Depends on how you would convert Delphi application to Lazarus.
The point is most likely irrelevant for this case, anyway. @Carring is active on this forum long ago before we got Delphi compatibility, heâs developing his application in FPC/Lazarus from a long time. He was compiling it successfully in the past using FPC/Lazarus, as numerous threads on this forum show
We donât really have enough information to speculate here. We need a reproducible testcase showing the problem to tell what is the reason/solution for these WSRegisterXXXX problems.
Meanwhile I googled around for this and I found
https://www.askingbox.com/question/lazarus-program-without-gui-many-wsregister-errors
Then I added âInterfacesâ in the file and everything is fine again.
I think it strange as it only happened after last CGE update?
Itâs indeed strange and it should not be needed. No CGE examples need it. CGE in fact (when you use TCastleWindow) should not need any unit from LCL. I realize you solved the problem on your side, but Iâd still like to debug it more:) To make sure we know what was the cause, and we can address it on CGE side if necessary.
-
Try CGE examples. Like examples/animations/play_animation
-
Submit a test case to reproduce, ideally a stripped down version of your project that still requires Interfaces unit on your side.
The examples work fine.
Then I outcommented the implementation part of my project code and it gave no errors, so there probably is something in the implementation part that causes the error (that wasnât before the last CGE update).
So I think I will have to outcomment every procedure in the implementation part one by one to find out where the code is that causes this error.
That will be a lot of trying things out but I guess it is for the benefit of CGE.
There isnât that much in implementation section that could trigger this. Look at uses clause â what do you use there?
If you have some other unit depending on LCL (like LazarusPackageIntf
that you mentioned earlier) then that is definitely the culprit. You should not use LazarusPackageIntf
(it is only for code that registers property editors in LCL â even most TCastleControl applications should not need it).
I did not add lazarusPackageIntf and I donât see it in the unit list, so how can I remove it from the project?
@Carring Dialogs
unit on your screenshot is from LCL. This is most likely the reason of your troubles. It defines some LCL message-boxes, like ShowMessage
, that you likely used.
In CGE, you can use MessageOK
from CastleMessages
or Window.MessageOK
.
The fact that it compiled previously means that probably
-
Your project had LCL in dependecies. (See âProject Inspectorâ â âRequired Packagesâ). Remove it, then such usage will not even compile, so youâll be safe.
-
You probably never compiled using F9 from CGE editor? As CGE editor doesnât pass paths to LCL, so compilation likely didnât work there. It will work once you remove LCL units from usage.
As for LazarusPackageIntf
â sorry, I was referring to your earlier message, that I see you deleted since. If you donât use it, then cool. (If you want to check, just use âFind in Filesâ in your project or any other grep-like tool to search for LazarusPackageIntf
).
Yes, I removed it and now everything compiles without error.
Yes, sometimes I use F9 from CGE. And my project runs fine with it (without the WSRegister errors).
The reason I mostly use F9 from Lazarus is that CGE editor does not show exactly what is wrong when there is a compiling error if I change code.