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

Build failure after adding webview2 crate #7

Closed
waf opened this issue May 9, 2020 · 4 comments
Closed

Build failure after adding webview2 crate #7

waf opened this issue May 9, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@waf
Copy link

waf commented May 9, 2020

Thanks for making this crate, it's really nice.

When I initially installed it in my application, it broke the build. I can fix it by adding a dev-dependency to my application, but is there a way to avoid this?

Cargo.toml:

[package]
name = "my-app"
version = "0.1.0"
authors = ["waf"]
edition = "2018"

[dependencies]
webview2 = "0.1.0-alpha.6"

Build error:

C:\Projects\my-app› cargo build
   Compiling webview2 v0.1.0-alpha.6
error[E0432]: unresolved import `winapi::shared::winerror`
  --> ~\.cargo\registry\src\github.com-1ecc6299db9ec823\webview2-0.1.0-alpha.6\src\lib.rs:47:21
   |
47 | use winapi::shared::winerror::{
   |                     ^^^^^^^^ could not find `winerror` in `shared`

error: aborting due to previous error

I can build my application again after adding the following dev-dependency to my-app:

[dev-dependencies]
winit = "0.20.0"

If this is hard to fix, I think adding a note to the readme is fine!

@blckngm blckngm added the bug Something isn't working label May 9, 2020
@blckngm
Copy link
Owner

blckngm commented May 9, 2020

It's because the winerror feature of winapi is missing in our dependencies. Should be easy to fix.

To workaround the problem, you don't need winit as a dev-dependency, just add winapi with the winerror feature as a dependency:

[dependencies]
winapi = { version = "0.3.8", features = ["winerror"] }

@blckngm
Copy link
Owner

blckngm commented May 9, 2020

rust-lang/cargo#1796

@blckngm blckngm closed this as completed in 9483539 May 9, 2020
@blckngm
Copy link
Owner

blckngm commented May 9, 2020

Fixed in 0.1.0-alpha.7.

@waf
Copy link
Author

waf commented May 9, 2020

Wow, fast turnaround! I can confirm that updating to 0.1.0-alpha.7 resolves the issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants