-
Notifications
You must be signed in to change notification settings - Fork 84
Description
UPDATE: I see this repo is deader than my aunt Susan. If you guys need someone to work on the project and revive things, I'd love to step up! Reach out if interested!
Description
When attempting to build an LVGL project using lvgl 0.6.2
, the compilation fails with multiple type mismatches (E0308
) due to event constants being defined as u32
instead of i32
. I did a bit of digging and although the generated type in the code is c_int, the code expects u32 and I believe c_int gets translated as i32 instead, leading to the issue.
This happens inside the support.rs
file of lvgl
, where match
statements expect i32
, but the event constants from lvgl-sys
are u32
.
Steps to Reproduce
- Install
lvgl
via Cargo:cargo add lvgl cargo build
- Compilation fails with the following errors:
(and similar errors for other event constants like
error[E0308]: mismatched types --> C:\Users\erick\.cargo\registry\src\index.crates.io-6f17d22bba15001f\lvgl-0.6.2\src\support.rs:154:13 | 143 | const LV_EVENT_PRESS_LOST: u32 = lvgl_sys::lv_event_code_t_LV_EVENT_PRESS_LOST; | ------------------------------ constant defined here ... 151 | match value { | ----- this expression has type `i32` ... 154 | LV_EVENT_PRESS_LOST => Ok(Event::PressLost), | ^^^^^^^^^^^^^^^^^^^ | | | expected `i32`, found `u32`
LV_EVENT_SHORT_CLICKED
,LV_EVENT_CLICKED
,LV_EVENT_LONG_PRESSED
, etc.)
Expected Behavior
The Rust LVGL bindings should correctly match the types of the event constants, so cargo build
should succeed.
Environment
- OS: Windows 11
- Rust version: 1.82.0
- LVGL version:
lvgl 0.6.2
- LVGL-Sys version:
lvgl-sys 0.6.2
Thanks in advance for looking into this! 🚀