Error while building GTK4 Application

Whilst building a new GTK4 rust application (completely empty, minus main method) I receive a very generic error code: 1.

'error: failed to run custom build command for graphene-sys v0.14.0
as well as
‘“pkg-config” “–libs” “–cflags” “graphene-gobject-1.0” “graphene-gobject-1.0 >= 1.10”` did not exit successfully: exit code: 1’

I am unable to rectify this issue and am looking for some assistance if possible! I am running windows 10 64.

How did you install GTK4, and do you have a) pkg-config in your PATH (e.g. from pkg-config-lite download | SourceForge.net ) and b) the directory with graphene-1.0.pc, gtk4.pc in PKG_CONFIG_PATH?

1 Like

I appreciate your response. Turns out I had a typo while installing graphene, and had never installed it! Resolved this issue; however I now do get failed to run custom build command for gsk4-sys v0.2.0 instead.

EDIT: I am currently reinstalling GTK4 and this may resolve the issue. I’ll keep you prompted. Thank you!

If it doesn’t work, please provide the full output and not just the last line :slight_smile:

1 Like

Thank you for all your help; a full reinstall of GTK4 has resolved the issue. :slight_smile:

I guess I had responded too soon :laughing:.

Compilation of the program results in no windowing at all, no errors and instead receive this:

That means that some DLL used by the application is not in your PATH. You need to make sure that all the GTK/etc DLLs are in your PATH.

You can use https://github.com/lucasg/Dependencies on target\debug\animation.exe to see which DLLs it needs, and which ones it doesn’t find.

I had ran the Dependencies application (and might I add, wow this thing is amazing).

I had ended up with these missing DLL’s.

I think you need the VC redistributable libraries for that: The latest supported Visual C++ downloads

Unclear how you ended up in this situation though, must be from the GTK4 binaries you got.

Do you think this could be because I already had a previous installation of GTK?(GTK3)

No, but you need to be careful to not mix different versions of libraries in the PATH or otherwise you might end up with conflicts.

Where did you get GTK3 and GTK4 from btw?

I followed the Windows installation tutorial on ‘The GTK Project’ found here:

pacman -S mingw-w64-x86_64-gtk4

Ok, so via msys2. That should give you everything you need in theory, you’d have to check with the msys2 project why that is not the case for you.

Did installing the VC redistributable bundle fix it though? My guess is also that you’re currently mixing compilers: msys2 uses gcc/mingw, your Rust toolchain uses the MS toolchain. That should not necessarily be a problem but you probably have less confusion by installing the gcc/mingw Rust toolchain too. rustup can do that for you.

I’m looking into the toolchains now; however right before your initial response about VC, I had already installed and restarted with no resolution.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.