Headlight_test Exception

I was playing around with the ‘headlight_test’ file and received an Exception, Failed to compile, status 1.

I’ve attached the complete text log, but here’s the end of the file where the error(s) started happening. Thanks for looking :slightly_smiling_face:


Compiling .\code\gameinitialize.pas
gameinitialize.pas(29,28) Warning: Symbol "TCastleWindowBase" is deprecated: "use TCastleWindow"
gameinitialize.pas(88,18) Warning: Symbol "UseHeadlight" is deprecated: "create TCastleDirectionalLight and add it as TCastleCamera child, for a more flexible headlight"
gameinitialize.pas(93,18) Warning: Symbol "UseHeadlight" is deprecated: "create TCastleDirectionalLight and add it as TCastleCamera child, for a more flexible headlight"
gameinitialize.pas(143,12) Warning: Symbol "AutoCamera" is deprecated: "it is simpler to set camera at design-time explicitly, or use CameraViewpointForWholeScene to auto-adjust camera; if you want to animate the camera, attach TCastleCamera to a bone transformation exposed by Scene.ExposeTransforms"
gameinitialize.pas(144,12) Error: identifier idents no member "AutoNavigation"
gameinitialize.pas(155,18) Warning: Symbol "MainScene" is deprecated: "leave MainScene unset; almost all useful MainScene features can be now achieved without setting MainScene"
gameinitialize.pas(160,12) Error: identifier idents no member "NavigationType"
gameinitialize.pas(161,12) Error: identifier idents no member "WalkNavigation"
gameinitialize.pas(166,18) Warning: Symbol "UseHeadlight" is deprecated: "create TCastleDirectionalLight and add it as TCastleCamera child, for a more flexible headlight"
gameinitialize.pas(179,30) Warning: Symbol "TCastleWindowBase" is deprecated: "use TCastleWindow"
gameinitialize.pas(183) Fatal: There were 3 errors compiling module, stopping
Fatal: Compilation aborted
Error: C:\lazarus\fpc\3.2.2\bin\x86_64-win64\ppcx64.exe returned an error exitcode
Exception "Exception":
Failed to compile

Command finished with status 1.

headlight_test_exception.txt (21.9 KB)

The examples\viewport_and_scenes\headlight example works without any issues for me. Please make sure you are using the same version of the examples and of Castle Game Engine. Note that if you have several copies of the Engine installed Lazarus can occasionally get confused which one to use, so it’s better to have just one copy.

1 Like

Indeed, the error report indicates you use a newer version of the engine with old example.

This is usually OK (because we try hard to keep backward compatibility) but not always (because sometimes we just have to break compatibility, we always make a news about it with reasoning – in this particular case AutoNavigation and friends have been moved to a different deprecated class as part of big cameras rework, Camera and navigation rework almost finished. TODO: This news announcement is too long, we have too much new stuff to announce – Castle Game Engine ).

See whether you have CASTLE_ENGINE_PATH environment variable defined (you probably don’t need to define it – maybe it points to a different engine version). See how you run the CGE editor – it is simplest to just run it in bin/castle-engine inside the latest engine version.

1 Like

Thank you for taking a look and for the suggestions. :slight_smile: