Can not build gzp with cargo

Hi,

I am having a bizarre issue with compiling gzp.
Test 1:

  1. Create a new binary project,
  2. add gzp as dependency
  3. copy/paste the simplest example from the library documentation
  4. Source compiles successfully.

Test2:

  1. I already have a project that I want to add gzp, soo add through Cargo (cargo add gzp, check it is added in cargo.toml.
  2. All code using gzp is disabled.
  3. When I try to build the project I receive more than 25 errors similar to below
error[E0432]: unresolved import `flate2`
  --> C:\Users\User1\.cargo\registry\src\index.crates.io-6f17d22bba15001f\gzp-0.11.3\src/lib.rs:81:9
   |
81 | pub use flate2::Compression;
   |         ^^^^^^ use of undeclared crate or module `flate2`

Assuming the downloaded files are corrupt, I tried to delete everything under C:\Users\User1.cargo\registry\src\index.crates.io-6f17d22bba15001f but when I issue the cargo build, everything is copied back (not downloaded at it doesnt take more than a second) and I receive the same errors.

Are the two versions of gzp the same in both cases?

both are using gzip-0.11.3, so I assume they should be.

I figured it out, it turns out it was my mistake.
When writing the dependencies in cargo.toml

gzp = "0.11.3"

works but

gzp = { version = "0.11.3", default-features = false }

fails with the above errors all over the place.

gzp = { version = "0.11.3", default-features = false, features = ["deflate_rust"] }
------------------------------------------------------------------^^^^^^^^^^^^

you need to have any/some feature.

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.