Getting GTK-rs AboutDialog to compile

I have a cargo.toml with the following:

[package]
name = “AboutDialog”
version = “0.1.0”
edition = “2021”

[dependencies]
gtk4 = { path = “/usr/lib/x86_64-linux-gnu/pkgconfig”, version = “0.9.0”, features = [“v4_12”]}

You can see above that I am trying to let cargo know where the gtk4.pc file is located.

Link to AboutDialog

The compiler error message is as follows:

error: failed to get gtk4 as a dependency of package AboutDialog v0.1.0 (/home/jim/JimData/Code/Rust_Github_Examples_v4/AboutDialog)

Caused by:
failed to load source for dependency gtk4

Caused by:
Unable to update /usr/lib/x86_64-linux-gnu/pkgconfig

Caused by:
failed to read /usr/lib/x86_64-linux-gnu/pkgconfig/Cargo.toml

Caused by:
No such file or directory (os error 2)

There are many .pc files located here:

/usr/share/pkgconfig/

And the gtk4.pc is located here:

/usr/lib/x86_64-linux-gnu/pkgconfig/

I even tried moving a copy of the gtk4.pc file to the /usr/share/pkgconfig folder with no luck.

How do I let cargo know the location of the gtk4 file?

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