Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Failing to compile: error[E0432]: unresolved import windows::Win32::Graphics::Gdi #9583

Closed
dab0bby opened this issue Apr 26, 2024 · 1 comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@dab0bby
Copy link

dab0bby commented Apr 26, 2024

Describe the bug

Error building project with latest beta version. Error:

error[E0432]: unresolved import `windows::Win32::Graphics::Gdi`

Reproduction

Cargo.toml

[build-dependencies]
tauri-build = { version = "2.0.0-beta.13", features = [] }

[dependencies]
clap = { version = "4.5.4", features = ["derive"] }
clap_derive = "4.5.4"
futures = { version = "0.3.30", features = [] }
reqwest = { version = "0.12.4", features = ["json", "stream"] }
serde = { version = "1.0.198", features = ["derive"] }
serde_json = "1.0.116"
sysinfo = { version = "0.30.11", features = [] }
tauri = { version = "2.0.0-beta.16", features = [] }
tokio = { version = "1.37.0", features = ["full"] }

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", features = ["winbase", "handleapi", "processthreadsapi", "winnt", "securitybaseapi", "impl-default", "shellapi"] }

[features]
# this feature is used for production builds or when `devPath` points to the filesystem
# DO NOT REMOVE!!
custom-protocol = ["tauri/custom-protocol"]

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 124.0.2478.51
    ✔ MSVC: Visual Studio Professional 2022
    ✔ rustc: 1.77.2 (25ef9e3d8 2024-04-09)
    ✔ cargo: 1.77.2 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 21.7.3
    - yarn: 1.22.19
    - npm: 8.10.0

[-] Packages
    - tauri [RUST]: 2.0.0-beta.16
    - tauri-build [RUST]: 2.0.0-beta.13
    - wry [RUST]: 0.39.0
    - tao [RUST]: 0.27.0
    - @tauri-apps/api [NPM]: 2.0.0-beta.9
    - @tauri-apps/cli [NPM]: 2.0.0-beta.13

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace

Compiling tauri-runtime-wry v2.0.0-beta.13
error[E0432]: unresolved import `windows::Win32::Graphics::Gdi`
    --> C:\Users\Bob\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-runtime-wry-2.0.0-beta.13\src\lib.rs:4116:35
     |
4116 |     use windows::Win32::Graphics::Gdi::{GetMonitorInfoW, HMONITOR, MONITORINFO};
     |                                   ^^^ could not find `Gdi` in `Graphics`

error[E0308]: mismatched types
    --> C:\Users\Bob\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-runtime-wry-2.0.0-beta.13\src\lib.rs:3082:29
     |
3082 |                 controller: webview.controller(),
     |                             ^^^^^^^^^^^^^^^^^^^^ expected `ICoreWebView2Controller`, found a different `ICoreWebView2Controller`
     |
     = note: `ICoreWebView2Controller` and `ICoreWebView2Controller` have similar names, but are actually distinct types
@dab0bby dab0bby added status: needs triage This issue needs to triage, applied to new issues type: bug labels Apr 26, 2024
@amrbashir
Copy link
Member

run cargo update inside src-tauri and it should work

@amrbashir amrbashir closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants