1

I am trying to build a hello world project to see if gtk4-rs is working correctly, which always fails at creating the binaries. The rest of the build seems to fine (tried to run cargo clean and cargo check a couple of times, those do not produce any errors). My Cargo.toml just uses the version specified in the crate:

[dependencies]
gtk4 = "0.4.8"

My error is exactly the same as the one in this question, but running the cargo build in an admin powershell also fails with the same error.

I am on Win 11 and I've followed the installation instructions linked to by GTK themselves, https://github.com/wingtk/gvsbuild.

The linking error seems to indicate that gobject-2.0.lib is missing:

LINK : fatal error LNK1181: cannot open input file 'gobject-2.0.lib'

(Full error message (with redacted user directory) on Pastebin)

That file is found at c:\gtk-build\gtk\x64\release\lib, which is the default location for an installation produced by gvsbuild, as far as I can tell (I haven't messed with the files at all). Both c:\gtk-build\gtk\x64\release\lib and c:\gtk-build\gtk\x64\release\bin are part of the path, restarting the machine did not seem to fix anything in this regard either.

I have not found anything close to helpful on the internet, so any pointers to what could be wrong here would be great.

1
  • After poking around for a bit more, I think the the problem lies in the fact that - for some reason - in the LIBPATH for several files is incorrectly set to "/LIBPATH:C:gtk-buildgtkx64release/lib", which should(?) be "/LIBPATH:C:\\gtk-build\\gtk\\x64\\release\\lib". I cannot see why this occurs, what causes this or how I could fix this. Commented Sep 20, 2022 at 14:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.