lvgl / lv_demos

Examples, tutorials and applications for the LVGL embedded GUI library
https://lvgl.io
489 stars 366 forks source link

Compiling lv_ex_img_3 will not work without LV_USE_DEMO_MUSIC being defined #88

Closed MCF closed 3 years ago

MCF commented 3 years ago

The definition of the img_lv_demo_music_cover_1 variable is found inside a #if LV_USE_DEMO_MUSIC block. That variable is used inside the lv_ex_img_3 example function, referenced using an extern declaration. If LV_USE_DEMO_MUSIC is not defined then the compilation fails with the following message in visual studio (for example).

Error   LNK2001 unresolved external symbol img_lv_demo_music_cover_1    lv_sim_visual_studio_sdl    C:\Users\mikef\source\repos\lv_sim_visual_studio_sdl\visual_studio_2017_sdl\lv_ex_img_3.obj 1

This could be fixed in a number of ways but I'm not sure what the vision for lv_ex_img_3 was. It seems odd that it pulls in a variable from the assets in the lv_demo_music directory tree. You could define LV_USE_DEMO_MUSIC inside the lv_ec_img_3.c file but that would seem like a misuse of that macro. Move that asset out of the lv_demo_muse and into the more general src/assets directory? Do not wrapt the definition of img_lv_demo_music_cover_1 in the #if/#endif block?

kisvegabor commented 3 years ago

Upps, it was overwritten accidentally. img_cogwheel_argb should have been there.

I've fixed it here: dd82bf8