Compile and Run Issue

Hello,

I am using the castle engine on Void linux. I am trying to compile the default empty program and it results in the following errors:

Warning: “crtbegin.o” not found, this will probably cause a linking failure

Warning: “crtend.o” not found, this will probabl-y cause a linking failure

/usr/bin/ld: cannot find -lgtk-3: No such file or directory

I can’t find any gtk3 libraries and the ones that I do find are related to the D programming language.

Thanks for any help!

1 Like

I have just figured out the issue, in case anyone else who might have the same or similar error,

I used the command:

ld -lgtk-3 --verbose > ISSUE.TXT

And it was mentioning libgtk3 libraries so I looked for the equivalent of it and it turned out to be the package: gtk+3-devel

So install the libraries via:

sudo xbps-install -Su gtk+3-devel

And everything should be fine. It is required for the crt stuff I think.

Hope everyone has a great day!

2 Likes

Exactly, I see you found the solution already: one needs to install the “development” versions of the libraries we use. They contain proper files (libgtk-3.so, a symlink to proper version on your system) necessary to link our applications.

Note that your users (who just run the executable provided by you) don’t need this package. Only you need it, that is: as a developer you need it to “link” (last part of building the executable) on your system.

All the libraries we use right now, with recommended one-line commands to install them on various Linux distributions, are mentioned in the “Linux and FreeBSD packages” section of our “Download” page. I have just now :

  • Moved this section to “Download” page. (Previously it was part of compiling from source, less prominent and also incorrect place: since you need these libraries to build your games, not only engine tools).,

  • Added there Void Linux section with the command you reported. (I only recently heard about Void, and thanks to your post it is now mentioned there :slight_smile: Personally, most of my life I spend on Debian-based distros, though I plan some experiments with new distros on vacation.)

    If you want to fix / extend that xbps-install line (maybe to mention other libraries from that section too), or really anything on that page, you’re most welcome! You can just post here, or you can edit it on GitHub and create a pull request.

Best regards!

Oh, and about these 2 lines:

  • They are unrelated to GTK 3 issues.

  • and they occur when older FPC versions are combined with specific version of ld (linker). From what I know, they are not avoidable (unless you want to change FPC version e.g. by installing unstable FPC 3.3.1 from fpcupdeluxe or a different linker version). But they are also completely harmless – despite sounding “alarming”, what they mention will actually not cause a linking failure. (I recall I saw posts from FPC developers confirming this, but cannot find it now.) Hopefully, we will soon see FPC 3.2.4 stable release, and then “just upgrading to latest FPC” will make these warnings go away.

  • I know they sound like related – they warn about linking failure, and you got a linking failure :), but it was really a coincidence, your linking failure was caused only by gtk+3-devel missing.

IOW, you likely still see these crtbegin/end warnings, but they can be just ignored:)