unknownue/vulkan-tutorial-rust

Compilation errors

Closed this issue · 5 comments

I cannot compile with stable or nightly with the following errors:

error[E0283]: type annotations needed: cannot resolve `_: std::convert::Into<winit::dpi::Size>`
  --> src\utility\window.rs:16:10
   |
16 |         .with_inner_size((width, height).into())
   |          ^^^^^^^^^^^^^^^

error[E0599]: no variant or associated item named `EventsCleared` found for type `winit::event::Event<'_, _>` in the current scope
  --> src\utility\window.rs:75:26
   |
75 |                 | Event::EventsCleared => {
   |                          ^^^^^^^^^^^^^
   |                          |
   |                          variant or associated item not found in `winit::event::Event<'_, _>`
   |                          help: there is a variant with a similar name: `MainEventsCleared`

This is caused by the API change of winit v0.20.0. It may take me some days to fix it.

Sometime the version you specify in Cargo.toml may not match the actual version written in Cargo.lock. You can specify winit version to 0.20.0-alpha4. The compilation is work for this version on my computer. If it doesn't work, try to specify other version from 0.20.0-alpha3 to 0.20.0-alpha6.

[dependencies]
winit = "=0.20.0-alpha4"  # Use '=' to specify the exact version you want

That worked for me

This issue should be fixed in abceb29.
If it still not compiles on your computer, open this issue again.