Skip to content

error[E0432]: unresolved import winapi::shared::winerror #6

@jiebanghan

Description

@jiebanghan

when I according https://medium.com/@solidquant/100-hours-of-building-a-sandwich-bot-a89235281da3,
when come to this step:

Running the current Rust program by doing:

cargo run

then I type cargo run on my win10 PC, It shows below:

D:\data\sandooo>cargo run
    Updating git repository `https://github.com/elast0ny/shared_memory-rs`
    Updating crates.io index
     Locking 9 packages to latest compatible versions
      Adding nix v0.26.4 (latest: v0.29.0)
      Adding shared_memory v0.12.5 (https://github.com/elast0ny/shared_memory-rs#fda41341)
      Adding win-sys v0.3.1
      Adding windows v0.34.0 (latest: v0.58.0)
      Adding windows_aarch64_msvc v0.34.0 (latest: v0.52.6)
      Adding windows_i686_gnu v0.34.0 (latest: v0.52.6)
      Adding windows_i686_msvc v0.34.0 (latest: v0.52.6)
      Adding windows_x86_64_gnu v0.34.0 (latest: v0.52.6)
      Adding windows_x86_64_msvc v0.34.0 (latest: v0.52.6)
  Downloaded windows_x86_64_msvc v0.34.0
  Downloaded win-sys v0.3.1
  Downloaded windows v0.34.0
  Downloaded 3 crates (14.7 MB) in 14.69s (largest was `windows` at 14.0 MB)
   Compiling ethers-solc v2.0.14
   Compiling ethers-providers v2.0.14
   Compiling windows_x86_64_msvc v0.34.0
   Compiling tower v0.4.13
   Compiling anyhow v1.0.86
   Compiling revm-primitives v1.2.0 (https://github.com/bluealloy/revm/?rev=80c909d6f242886cb26e6103a01d1a4bf9468426#80c909d6)
   Compiling darling_macro v0.13.4
   Compiling futures-locks v0.7.1
   Compiling proc-macro-error v1.0.4
   Compiling block-padding v0.2.1
   Compiling libc v0.2.155
   Compiling erasable v1.2.1
   Compiling num v0.4.3
   Compiling proc-macro-error-attr v1.0.4
   Compiling ethbloom v0.11.1
   Compiling primitive-types v0.9.1
error[E0432]: unresolved import `winapi::shared::winerror`
  --> C:\Users\User\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ethers-providers-2.0.14\src\rpc\transports\ipc.rs:61:9
   |
61 |     use winapi::shared::winerror;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^ no `winerror` in `shared`
   |
note: found an item that was configured out
  --> C:\Users\User\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winapi-0.3.9\src\shared\mod.rs:84:38
   |
84 | #[cfg(feature = "winerror")] pub mod winerror;
   |                                      ^^^^^^^^
   = note: the item is gated behind the `winerror` feature

   Compiling hyper-util v0.1.6
   Compiling http-body-util v0.1.2
   Compiling darling v0.13.4
   Compiling ethers-addressbook v2.0.14
   Compiling block-buffer v0.9.0
For more information about this error, try `rustc --explain E0432`.
error: could not compile `ethers-providers` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

So would you please tell me how to solve it ? thank you very much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions