We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://forum.lvgl.io/t/using-images-in-lvgl-getting-error-expected-primary-expression-before-token/4983
This issue occured to me, when using the converter and then compiling the resulting code in a c++ project. The solution is written in the post too:
If you put the fields in the exact order as they are defined in the structs it should also work in cpp:
const lv_img_dsc_t SoS_Skull = { .header.cf = LV_IMG_CF_RAW_ALPHA, .header.always_zero = 0, .header.reserved = 0, .header.w = 191, .header.h = 237, .data_size = 11505, .data = SoS_Skull_map, };
Could the converter order the fields this way?
The text was updated successfully, but these errors were encountered:
After some testing, I've found two different orderings, that worked:
const lv_img_dsc_t Window = { .header = { .cf = LV_IMG_CF_TRUE_COLOR, .always_zero = 0, .reserved = 2, .w = 240, .h = 240, }, .data_size = 57600 * LV_COLOR_SIZE / 8, .data = Window_map, };
and
const lv_img_dsc_t Window = { { LV_IMG_CF_TRUE_COLOR, 0, 2, 240, 240, }, 57600 * LV_COLOR_SIZE / 8, Window_map, };
The order matters, for both of them. If this isn't desirable for the default behaviour, it could be set with some flag
Sorry, something went wrong.
No branches or pull requests
https://forum.lvgl.io/t/using-images-in-lvgl-getting-error-expected-primary-expression-before-token/4983
This issue occured to me, when using the converter and then compiling the resulting code in a c++ project. The solution is written in the post too:
If you put the fields in the exact order as they are defined in the structs it should also work in cpp:
const lv_img_dsc_t SoS_Skull = {
.header.cf = LV_IMG_CF_RAW_ALPHA,
.header.always_zero = 0,
.header.reserved = 0,
.header.w = 191,
.header.h = 237,
.data_size = 11505,
.data = SoS_Skull_map,
};
Could the converter order the fields this way?
The text was updated successfully, but these errors were encountered: