Command finished with status 256.

Hello.
I apologize for the machine translation.

When trying to compile any of the examples, it outputs the following:
Compiling project “custom_cursor” for OS / CPU “linux / x86_64” in mode “debug”.
FPC executing…
Free Pascal Compiler version 3.2.2 [2024/08/05] for x86_64
Target OS: Linux for x86-64
Compiling custom_cursor_standalone.dpr

Linking custom_cursor_standalone
Warning: “crtbegin.o” not found, this will probably cause a linking failure
Warning: “crtend.o” not found, this will probably cause a linking failure
/usr/bin/ld: cannot be found -lgtk-x11-2.0: No such file or directory
/usr/bin/ld: cannot be found -lgdk-x11-2.0: No such file or directory
/usr/bin/ld: cannot be found -lgobject-2.0: No such file or directory
/usr/bin/ld: cannot be found -lglib-2.0: No such file or directory
/usr/bin/ld: cannot be found -lgthread-2.0: No such file or directory
/usr/bin/ld: cannot be found -lgmodule-2.0: No such file or directory
/usr/bin/ld: cannot be found -lX11: No such file or directory
Error: Error while linking
Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: castle_game_engine/tools/contrib/fpc/bin/ppcx64 returned an error exitcode
Exception “Exception”:
Failed to compile
Command finished with status 256.
But all these files are in the system and are located in /usr/lib.
If I understood correctly, the linker does not find the libraries it needs.
Questions
Why Castle Game Engine does not find them when compiling.
How can I tell the linker where these files are located, or the problem can be solved in some other way.
Lazarus is not installed.
To view and write code for learning, I thought to use a simple editor(geany) to start.
Linux Mint 21.3 Cinnamon
Thanks

On most Linux distributions (like Mint, derived from Ubuntu derived from Debian) to build programs that link to given libraries, you need to install some additional packages with -dev in the name.

The list is on Compiling from source | Manual | Castle Game Engine . In short, you most likely need to install libgtk2.0-dev. From command-line, you could do

sudo apt install libgtk2.0-dev

but of course you don’t need to use command-line :), you can use any GUI package manager to find and install libgtk2.0-dev.

Note that your users (people who get compiled applications from you) do not need to install these xxx-dev packages. They only need libgtk2.0 which they probably have already installed by default.

Thank you very much for the reply.
I will try to do as you wrote and then report the result.

Everything is working!!! As you said, I installed libgtk2.0-dev and everything compiles.
Apparently all the other libraries were installed along with this one.
Thanks to you, I learned something new about Linux, it seemed to me that I just needed to tell the compiler where to look for libraries in the castle-fpc.cfg or CastleEngineManifest files.
I’ve been watching your engine for a long time, waiting with interest for it to appear on Steam, and especially the ability to create for the Web.
Good luck to you and your team.
Thank you very much.

I’m happy the problem is solved and thanks for the good words about the engine!

We’re indeed working actively on these things. Recently we added Steam integration ( Steam | Manual | Castle Game Engine , Steam Integration – Castle Game Engine ) which is an important step towards releasing the engine itself on Steam (you can watch this GitHub issue: Publish Castle Game Engine to Steam · Issue #480 · castle-engine/castle-engine · GitHub ).

And as for web: I just made a significant progress on it over the weekend. Our code compiles and executes in the browser – we get the logs produced by engine logging (CastleLog) correctly (but no rendering yet, so it’s not yet really impressive). Some preliminary information is on Web Target | Manual | Castle Game Engine , this page will be updated in the upcoming days as we make more progress.

This is very encouraging.
So many things have already been implemented in the Castle Game Engine and are working. This gives confidence that your team will succeed with the implementation of these things.
Thanks again and all the best.

2 Likes