lvgl / lv_port_pc_visual_studio

Visual Studio projects for LVGL embedded graphics library. Recommended on Windows. Linux support with Wayland is work in progress.
MIT License
606 stars 305 forks source link

VS2022 v9.0.0 can't display img (lv_img_set_src(img, &picture); ) #77

Open Bendikos opened 4 months ago

Bendikos commented 4 months ago

图片

But CodeBlocks lvgl9.1 can display images normally!

图片

laishanhai1040 commented 2 months ago

I also encountered the same problem. The examples and demos were normal, but the code I wrote myself did not work.

laishanhai1040 commented 2 months ago

我发现这是 C 和 C++ 语法不同的原因,经过测试,可以为 lvgl 生成的 img_test.c 添加一个 img_test.h 文件,并且添加上 '''#ifdef __cplusplus extern "C" {

endif

extern const lv_image_dsc_t img_test;

ifdef __cplusplus

} /extern "C"/

endif '''

在我的电脑上测试是可以正常显示的。