itadinanta / rust-oids

A-life simulator sandbox in Rust
Apache License 2.0
156 stars 8 forks source link

Can not buld on Windows 10. #9

Closed TheCodeingPadawan closed 5 years ago

TheCodeingPadawan commented 5 years ago

I can not build on windows 10 pro 1903.

Toolchain : nightly-x86_64-pc-windows-msvc rustc 1.40.0-nightly (0e8a4b441 2019-10-16)

Error:

error[E0308]: mismatched types
  --> src\frontend\input\gamepad.rs:66:58
   |
66 |                 to_key(button).map(|key| input::Event::GamepadButton(e.id, input::State::Down, key)),
   |                                                                      ^^^^ expected usize, found struct `gilrs::GamepadId`
   |
   = note: expected type `usize`
              found type `gilrs::GamepadId`

error[E0308]: mismatched types
  --> src\frontend\input\gamepad.rs:68:58
   |
68 |                 to_key(button).map(|key| input::Event::GamepadButton(e.id, input::State::Up, key)),
   |                                                                      ^^^^ expected usize, found struct `gilrs::GamepadId`
   |
   = note: expected type `usize`
              found type `gilrs::GamepadId`

error[E0308]: mismatched types
  --> src\frontend\input\gamepad.rs:70:84
   |
70 |                 from_button(gilrs::Button::RightTrigger2).map(|axis| input::Event::GamepadAxis(e.id, value, axis)),
   |                                                                                                ^^^^ expected usize, found struct `gilrs::GamepadId`
   |
   = note: expected type `usize`
              found type `gilrs::GamepadId`

error[E0308]: mismatched types
  --> src\frontend\input\gamepad.rs:72:83
   |
72 |                 from_button(gilrs::Button::LeftTrigger2).map(|axis| input::Event::GamepadAxis(e.id, value, axis)),
   |                                                                                               ^^^^ expected usize, found struct `gilrs::GamepadId`
   |
   = note: expected type `usize`
              found type `gilrs::GamepadId`

error[E0308]: mismatched types
  --> src\frontend\input\gamepad.rs:74:58
   |
74 |                 from_axis(axis).map(|axis| input::Event::GamepadAxis(e.id, value, axis)),
   |                                                                      ^^^^ expected usize, found struct `gilrs::GamepadId`
   |
   = note: expected type `usize`
              found type `gilrs::GamepadId`

error: aborting due to 5 previous errors
TheCodeingPadawan commented 5 years ago

Managed to get it to compile by commenting out the lines 65 - 74 in src\frontend\input\gamepad.rs

match e.event {
            /* gilrs::EventType::ButtonPressed(button, _) =>
                to_key(button).map(|key| input::Event::GamepadButton(e.id, input::State::Down, key)),
            gilrs::EventType::ButtonReleased(button, _) =>
                to_key(button).map(|key| input::Event::GamepadButton(e.id, input::State::Up, key)),
            gilrs::EventType::ButtonChanged(gilrs::Button::RightTrigger2, value, _) =>
                from_button(gilrs::Button::RightTrigger2).map(|axis| input::Event::GamepadAxis(e.id, value, axis)),
            gilrs::EventType::ButtonChanged(gilrs::Button::LeftTrigger2, value, _) =>
                from_button(gilrs::Button::LeftTrigger2).map(|axis| input::Event::GamepadAxis(e.id, value, axis)),
            gilrs::EventType::AxisChanged(axis, value, _) =>
                from_axis(axis).map(|axis| input::Event::GamepadAxis(e.id, value, axis)), */
            _ => None,
        }
norru commented 5 years ago

I'll have a look - it's likely an error in a dependency version. Thanks for reporting!

norru commented 5 years ago

@Ad-Man-Gamer please reopen if fix failed.

TheCodeingPadawan commented 5 years ago

It now compiles without warnings nor errors.