Cargo Init does not activate lib gio and blueprint features

I'm starting in rust and after running cargo init I get the result:


 Updating crates.io index
      Adding gtk4 v0.8.1 to dependencies.
             Features:
             + v4_2
             + v4_4
             + v4_6
             +v4_8
             - blueprint
             - gio_v2_80
             - gnome_42
             - gnome_43
             - gnome_44
             - gnome_45
             - gnome_46
             - unsafe-assume-initialized
             - v4_10
             - v4_12
             - v4_14
             - xml_validation
    Updating crates.io index

My question is, the lib gio and blueprint are already supported by the active features and I don't need to activate them. I tried to activate using:

gio = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "gio" }

However, I had some errors and couldn't resolve them.

Then. Can I use the gio and blueprint resources even without activating them?

Version
Cargo - cargo 1.76.0 (c84b36747 2024-01-18)
Rust - rustc 1.76.0 (07dca489a 2024-02-04)
Gtk - gtk4 4.6.9

My question is, the lib gio and blueprint are already supported by the active features

The output from cargo add that you quoted is telling you that the features blueprint and gio_v2_80 are not enabled but that they exist, so that you know you could enable them.

I tried to activate using:

gio = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "gio" }

Adding another library dependency is different from enabling a feature of an existing library. Which one you need depends on what you want to do.

However, I had some errors and couldn't resolve them.

Show us the errors!

Can I use the gio and blueprint resources even without activating them?

Depends on what you mean by "resources" — that's not a Cargo concept. You'll need to tell us more about the code you're writing and what is going wrong.

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.