From 361663ee5f5d632854c8f50a1146b8b5e2fc3def Mon Sep 17 00:00:00 2001 From: 1000len-4959 <148859246+1000len-4959@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:34:50 +0100 Subject: [PATCH] feat(build): make it work with MSVC build (#4704) Signed-off-by: YanXiaowei Signed-off-by: dependabot[bot] Co-authored-by: Gabor Kiss-Vamosi Co-authored-by: bjsylvia Co-authored-by: YanXiaowei Co-authored-by: Niklas Fiekas Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: lhdjply <1029652979@qq.com> --- CMakeLists.txt | 10 ++++++++++ demos/lv_demos.c | 3 +-- lv_conf_template.h | 3 +++ src/core/lv_obj.h | 2 +- src/lv_conf_internal.h | 9 +++++++++ src/widgets/animimage/lv_animimage.h | 2 +- src/widgets/arc/lv_arc.h | 2 +- src/widgets/bar/lv_bar.h | 2 +- src/widgets/button/lv_button.h | 2 +- src/widgets/buttonmatrix/lv_buttonmatrix.h | 2 +- src/widgets/calendar/lv_calendar.h | 2 +- .../calendar/lv_calendar_header_arrow.h | 2 +- .../calendar/lv_calendar_header_dropdown.h | 2 +- src/widgets/canvas/lv_canvas.h | 2 +- src/widgets/chart/lv_chart.h | 2 +- src/widgets/checkbox/lv_checkbox.h | 2 +- src/widgets/image/lv_image.h | 2 +- src/widgets/imgbtn/lv_imgbtn.h | 2 +- src/widgets/keyboard/lv_keyboard.h | 2 +- src/widgets/label/lv_label.h | 2 +- src/widgets/led/lv_led.h | 2 +- src/widgets/line/lv_line.h | 2 +- src/widgets/list/lv_list.h | 6 +++--- src/widgets/menu/lv_menu.h | 18 +++++++++--------- src/widgets/msgbox/lv_msgbox.h | 6 +++--- src/widgets/objx_templ/lv_objx_templ.h | 2 +- src/widgets/roller/lv_roller.h | 2 +- src/widgets/scale/lv_scale.h | 2 +- src/widgets/slider/lv_slider.h | 2 +- src/widgets/span/lv_span.h | 2 +- src/widgets/spinbox/lv_spinbox.h | 2 +- src/widgets/spinner/lv_spinner.h | 2 +- src/widgets/switch/lv_switch.h | 2 +- src/widgets/table/lv_table.h | 2 +- src/widgets/tabview/lv_tabview.h | 2 +- src/widgets/textarea/lv_textarea.h | 2 +- src/widgets/tileview/lv_tileview.h | 4 ++-- src/widgets/win/lv_win.h | 2 +- 38 files changed, 70 insertions(+), 49 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1f72b8417..2054b74534 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.12.4) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + if(NOT ESP_PLATFORM) project(lvgl HOMEPAGE_URL https://github.com/lvgl/lvgl) endif() @@ -15,3 +17,11 @@ elseif(MICROPY_DIR) else() include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/custom.cmake) endif() + +if (MSVC) + if (BUILD_SHARED_LIBS) + target_compile_definitions(lvgl PUBLIC LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllimport\)) + else() + target_compile_definitions(lvgl PUBLIC LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllexport\)) + endif() +endif() \ No newline at end of file diff --git a/demos/lv_demos.c b/demos/lv_demos.c index 56f0637b2a..d62dd2be60 100644 --- a/demos/lv_demos.c +++ b/demos/lv_demos.c @@ -11,11 +11,10 @@ #ifdef _MSC_VER #include -#else +#elif __linux__ #include #endif - #include "lv_demos.h" /********************* diff --git a/lv_conf_template.h b/lv_conf_template.h index 929cfaeab1..2c44f399e4 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -317,6 +317,9 @@ *should also appear on LVGL binding API such as Micropython.*/ #define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ +/*Prefix all global extern data with this*/ +#define LV_ATTRIBUTE_EXTERN_DATA + /* Use `float` as `lv_value_precise_t` */ #define LV_USE_FLOAT 0 diff --git a/src/core/lv_obj.h b/src/core/lv_obj.h index eacbbae398..6fb14598a7 100644 --- a/src/core/lv_obj.h +++ b/src/core/lv_obj.h @@ -196,7 +196,7 @@ enum { /** * Make the base object's class publicly available. */ -extern const lv_obj_class_t lv_obj_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_obj_class; /** * Special, rarely used attributes. diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index 5b0caea925..3c984dcf43 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -877,6 +877,15 @@ #endif #endif +/*Prefix all global extern data with this*/ +#ifndef LV_ATTRIBUTE_EXTERN_DATA + #ifdef CONFIG_LV_ATTRIBUTE_EXTERN_DATA + #define LV_ATTRIBUTE_EXTERN_DATA CONFIG_LV_ATTRIBUTE_EXTERN_DATA + #else + #define LV_ATTRIBUTE_EXTERN_DATA + #endif +#endif + /* Use `float` as `lv_value_precise_t` */ #ifndef LV_USE_FLOAT #ifdef CONFIG_LV_USE_FLOAT diff --git a/src/widgets/animimage/lv_animimage.h b/src/widgets/animimage/lv_animimage.h index 99bf2632cb..f57c48aa06 100644 --- a/src/widgets/animimage/lv_animimage.h +++ b/src/widgets/animimage/lv_animimage.h @@ -30,7 +30,7 @@ extern "C" { * TYPEDEFS **********************/ -extern const lv_obj_class_t lv_animimg_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_animimg_class; /*Data of image*/ typedef struct { diff --git a/src/widgets/arc/lv_arc.h b/src/widgets/arc/lv_arc.h index f13e920ff7..23a74e584c 100644 --- a/src/widgets/arc/lv_arc.h +++ b/src/widgets/arc/lv_arc.h @@ -59,7 +59,7 @@ typedef struct { int16_t knob_offset; /*knob offset from the main arc*/ } lv_arc_t; -extern const lv_obj_class_t lv_arc_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_arc_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/bar/lv_bar.h b/src/widgets/bar/lv_bar.h index d40437303d..fa4a9ba48e 100644 --- a/src/widgets/bar/lv_bar.h +++ b/src/widgets/bar/lv_bar.h @@ -61,7 +61,7 @@ typedef struct { lv_bar_mode_t mode : 2; /**< Type of bar*/ } lv_bar_t; -extern const lv_obj_class_t lv_bar_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_bar_class; /********************** diff --git a/src/widgets/button/lv_button.h b/src/widgets/button/lv_button.h index 669945d069..0a982b1ecc 100644 --- a/src/widgets/button/lv_button.h +++ b/src/widgets/button/lv_button.h @@ -30,7 +30,7 @@ typedef struct { lv_obj_t obj; } lv_button_t; -extern const lv_obj_class_t lv_button_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_button_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/buttonmatrix/lv_buttonmatrix.h b/src/widgets/buttonmatrix/lv_buttonmatrix.h index 552fd80ebb..d168fbc2b2 100644 --- a/src/widgets/buttonmatrix/lv_buttonmatrix.h +++ b/src/widgets/buttonmatrix/lv_buttonmatrix.h @@ -69,7 +69,7 @@ typedef struct { uint32_t one_check : 1; /*Single button toggled at once*/ } lv_buttonmatrix_t; -extern const lv_obj_class_t lv_buttonmatrix_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_buttonmatrix_class; /********************** diff --git a/src/widgets/calendar/lv_calendar.h b/src/widgets/calendar/lv_calendar.h index 67827cc090..03fc023177 100644 --- a/src/widgets/calendar/lv_calendar.h +++ b/src/widgets/calendar/lv_calendar.h @@ -47,7 +47,7 @@ typedef struct { char nums [7 * 6][4]; } lv_calendar_t; -extern const lv_obj_class_t lv_calendar_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_calendar_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/calendar/lv_calendar_header_arrow.h b/src/widgets/calendar/lv_calendar_header_arrow.h index 787e2b7dbb..a04b355cc7 100644 --- a/src/widgets/calendar/lv_calendar_header_arrow.h +++ b/src/widgets/calendar/lv_calendar_header_arrow.h @@ -23,7 +23,7 @@ extern "C" { /********************** * TYPEDEFS **********************/ -extern const lv_obj_class_t lv_calendar_header_arrow_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_calendar_header_arrow_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/calendar/lv_calendar_header_dropdown.h b/src/widgets/calendar/lv_calendar_header_dropdown.h index 4118f37a12..92f1f26bf4 100644 --- a/src/widgets/calendar/lv_calendar_header_dropdown.h +++ b/src/widgets/calendar/lv_calendar_header_dropdown.h @@ -23,7 +23,7 @@ extern "C" { /********************** * TYPEDEFS **********************/ -extern const lv_obj_class_t lv_calendar_header_dropdown_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_calendar_header_dropdown_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/canvas/lv_canvas.h b/src/widgets/canvas/lv_canvas.h index c63bf98b46..01efd85489 100644 --- a/src/widgets/canvas/lv_canvas.h +++ b/src/widgets/canvas/lv_canvas.h @@ -27,7 +27,7 @@ extern "C" { /********************** * TYPEDEFS **********************/ -extern const lv_obj_class_t lv_canvas_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_canvas_class; /*Data of canvas*/ typedef struct { diff --git a/src/widgets/chart/lv_chart.h b/src/widgets/chart/lv_chart.h index 3e7918c9a8..cd3a299ef2 100644 --- a/src/widgets/chart/lv_chart.h +++ b/src/widgets/chart/lv_chart.h @@ -120,7 +120,7 @@ typedef struct { lv_chart_update_mode_t update_mode : 1; } lv_chart_t; -extern const lv_obj_class_t lv_chart_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_chart_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/checkbox/lv_checkbox.h b/src/widgets/checkbox/lv_checkbox.h index 363f7580fe..62b156938a 100644 --- a/src/widgets/checkbox/lv_checkbox.h +++ b/src/widgets/checkbox/lv_checkbox.h @@ -32,7 +32,7 @@ typedef struct { uint32_t static_txt : 1; } lv_checkbox_t; -extern const lv_obj_class_t lv_checkbox_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_checkbox_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/image/lv_image.h b/src/widgets/image/lv_image.h index b6f1ef063d..f4567dac96 100644 --- a/src/widgets/image/lv_image.h +++ b/src/widgets/image/lv_image.h @@ -53,7 +53,7 @@ typedef struct { uint8_t obj_size_mode: 2; /*Image size mode when image size and object size is different.*/ } lv_image_t; -extern const lv_obj_class_t lv_image_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_image_class; /** * Image size mode, when image size and object size is different diff --git a/src/widgets/imgbtn/lv_imgbtn.h b/src/widgets/imgbtn/lv_imgbtn.h index effe708587..07c4776a89 100644 --- a/src/widgets/imgbtn/lv_imgbtn.h +++ b/src/widgets/imgbtn/lv_imgbtn.h @@ -46,7 +46,7 @@ typedef struct { lv_imgbtn_src_info_t src_right[_LV_IMGBTN_STATE_NUM]; /*Store right side images to each state*/ } lv_imgbtn_t; -extern const lv_obj_class_t lv_imgbtn_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_imgbtn_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/keyboard/lv_keyboard.h b/src/widgets/keyboard/lv_keyboard.h index 35bbc81a8b..4e939d121b 100644 --- a/src/widgets/keyboard/lv_keyboard.h +++ b/src/widgets/keyboard/lv_keyboard.h @@ -65,7 +65,7 @@ typedef struct { uint8_t popovers : 1; /*Show button titles in popovers on press*/ } lv_keyboard_t; -extern const lv_obj_class_t lv_keyboard_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_keyboard_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/label/lv_label.h b/src/widgets/label/lv_label.h index 05bd23a09f..b8d140322d 100644 --- a/src/widgets/label/lv_label.h +++ b/src/widgets/label/lv_label.h @@ -89,7 +89,7 @@ typedef struct { uint8_t invalid_size_cache : 1; /*1: Recalculate size and update cache*/ } lv_label_t; -extern const lv_obj_class_t lv_label_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_label_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/led/lv_led.h b/src/widgets/led/lv_led.h index fd7da38fd2..c9c3d42b74 100644 --- a/src/widgets/led/lv_led.h +++ b/src/widgets/led/lv_led.h @@ -41,7 +41,7 @@ typedef struct { uint8_t bright; /**< Current brightness of the LED (0..255)*/ } lv_led_t; -extern const lv_obj_class_t lv_led_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_led_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/line/lv_line.h b/src/widgets/line/lv_line.h index 7989eabcd3..6a2423a228 100644 --- a/src/widgets/line/lv_line.h +++ b/src/widgets/line/lv_line.h @@ -32,7 +32,7 @@ typedef struct { uint32_t y_inv : 1; /**< 1: y == 0 will be on the bottom*/ } lv_line_t; -extern const lv_obj_class_t lv_line_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_line_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/list/lv_list.h b/src/widgets/list/lv_list.h index fdf7e9a50b..7b751aa03e 100644 --- a/src/widgets/list/lv_list.h +++ b/src/widgets/list/lv_list.h @@ -25,9 +25,9 @@ extern "C" { * TYPEDEFS **********************/ -extern const lv_obj_class_t lv_list_class; -extern const lv_obj_class_t lv_list_text_class; -extern const lv_obj_class_t lv_list_button_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_list_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_list_text_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_list_button_class; /********************** * GLOBAL PROTOTYPES **********************/ diff --git a/src/widgets/menu/lv_menu.h b/src/widgets/menu/lv_menu.h index ba6939a500..8f0498a604 100644 --- a/src/widgets/menu/lv_menu.h +++ b/src/widgets/menu/lv_menu.h @@ -93,15 +93,15 @@ typedef struct { bool static_title; } lv_menu_page_t; -extern const lv_obj_class_t lv_menu_class; -extern const lv_obj_class_t lv_menu_page_class; -extern const lv_obj_class_t lv_menu_cont_class; -extern const lv_obj_class_t lv_menu_section_class; -extern const lv_obj_class_t lv_menu_separator_class; -extern const lv_obj_class_t lv_menu_sidebar_cont_class; -extern const lv_obj_class_t lv_menu_main_cont_class; -extern const lv_obj_class_t lv_menu_sidebar_header_cont_class; -extern const lv_obj_class_t lv_menu_main_header_cont_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_page_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_cont_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_section_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_separator_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_sidebar_cont_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_main_cont_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_sidebar_header_cont_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_main_header_cont_class; /********************** * GLOBAL PROTOTYPES **********************/ diff --git a/src/widgets/msgbox/lv_msgbox.h b/src/widgets/msgbox/lv_msgbox.h index b2cbb8536d..77efdf5af8 100644 --- a/src/widgets/msgbox/lv_msgbox.h +++ b/src/widgets/msgbox/lv_msgbox.h @@ -43,9 +43,9 @@ typedef struct { lv_obj_t * buttons; } lv_msgbox_t; -extern const lv_obj_class_t lv_msgbox_class; -extern const lv_obj_class_t lv_msgbox_content_class; -extern const lv_obj_class_t lv_msgbox_backdrop_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_msgbox_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_msgbox_content_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_msgbox_backdrop_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/objx_templ/lv_objx_templ.h b/src/widgets/objx_templ/lv_objx_templ.h index 9de5285b51..ccf1e1c3ec 100644 --- a/src/widgets/objx_templ/lv_objx_templ.h +++ b/src/widgets/objx_templ/lv_objx_templ.h @@ -39,7 +39,7 @@ typedef struct { /*New data for this type*/ } lv_templ_t; -extern const lv_obj_class_t lv_templ_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_templ_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/roller/lv_roller.h b/src/widgets/roller/lv_roller.h index 0ed5cb5d34..7dcbc45d02 100644 --- a/src/widgets/roller/lv_roller.h +++ b/src/widgets/roller/lv_roller.h @@ -55,7 +55,7 @@ typedef struct { uint32_t moved : 1; } lv_roller_t; -extern const lv_obj_class_t lv_roller_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_roller_class; /********************** diff --git a/src/widgets/scale/lv_scale.h b/src/widgets/scale/lv_scale.h index 1cd889d4e2..a6b9fae4fd 100644 --- a/src/widgets/scale/lv_scale.h +++ b/src/widgets/scale/lv_scale.h @@ -90,7 +90,7 @@ typedef struct { int32_t rotation; } lv_scale_t; -extern const lv_obj_class_t lv_scale_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_scale_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/slider/lv_slider.h b/src/widgets/slider/lv_slider.h index 1a41c36084..cf9cc0b1b8 100644 --- a/src/widgets/slider/lv_slider.h +++ b/src/widgets/slider/lv_slider.h @@ -53,7 +53,7 @@ typedef struct { uint8_t left_knob_focus : 1; /*1: with encoder now the right knob can be adjusted*/ } lv_slider_t; -extern const lv_obj_class_t lv_slider_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_slider_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/span/lv_span.h b/src/widgets/span/lv_span.h index 99fd1cc3f5..5922a3a7ee 100644 --- a/src/widgets/span/lv_span.h +++ b/src/widgets/span/lv_span.h @@ -73,7 +73,7 @@ typedef struct { uint32_t refresh : 1; /* the spangroup need refresh cache_w and cache_h */ } lv_spangroup_t; -extern const lv_obj_class_t lv_spangroup_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_spangroup_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/spinbox/lv_spinbox.h b/src/widgets/spinbox/lv_spinbox.h index 079ec29bf8..c835c61584 100644 --- a/src/widgets/spinbox/lv_spinbox.h +++ b/src/widgets/spinbox/lv_spinbox.h @@ -45,7 +45,7 @@ typedef struct { uint32_t digit_step_dir : 2; /* the direction the digit will step on encoder button press when editing*/ } lv_spinbox_t; -extern const lv_obj_class_t lv_spinbox_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_spinbox_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/spinner/lv_spinner.h b/src/widgets/spinner/lv_spinner.h index b9c0181038..5cdabecc72 100644 --- a/src/widgets/spinner/lv_spinner.h +++ b/src/widgets/spinner/lv_spinner.h @@ -29,7 +29,7 @@ extern "C" { /********************** * TYPEDEFS **********************/ -extern const lv_obj_class_t lv_spinner_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_spinner_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/switch/lv_switch.h b/src/widgets/switch/lv_switch.h index 57cb191eba..624c983468 100644 --- a/src/widgets/switch/lv_switch.h +++ b/src/widgets/switch/lv_switch.h @@ -35,7 +35,7 @@ typedef struct { int32_t anim_state; } lv_switch_t; -extern const lv_obj_class_t lv_switch_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_switch_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/table/lv_table.h b/src/widgets/table/lv_table.h index d74c697d23..6a4784cbab 100644 --- a/src/widgets/table/lv_table.h +++ b/src/widgets/table/lv_table.h @@ -61,7 +61,7 @@ typedef struct { uint32_t row_act; } lv_table_t; -extern const lv_obj_class_t lv_table_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_table_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/tabview/lv_tabview.h b/src/widgets/tabview/lv_tabview.h index 38d010bca8..3bfe738be7 100644 --- a/src/widgets/tabview/lv_tabview.h +++ b/src/widgets/tabview/lv_tabview.h @@ -33,7 +33,7 @@ typedef struct { lv_dir_t tab_pos; } lv_tabview_t; -extern const lv_obj_class_t lv_tabview_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_tabview_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/textarea/lv_textarea.h b/src/widgets/textarea/lv_textarea.h index 38ea775193..336585c348 100644 --- a/src/widgets/textarea/lv_textarea.h +++ b/src/widgets/textarea/lv_textarea.h @@ -63,7 +63,7 @@ typedef struct { uint8_t one_line : 1; /*One line mode (ignore line breaks)*/ } lv_textarea_t; -extern const lv_obj_class_t lv_textarea_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_textarea_class; enum { LV_PART_TEXTAREA_PLACEHOLDER = LV_PART_CUSTOM_FIRST, diff --git a/src/widgets/tileview/lv_tileview.h b/src/widgets/tileview/lv_tileview.h index 5f35251735..783e025658 100644 --- a/src/widgets/tileview/lv_tileview.h +++ b/src/widgets/tileview/lv_tileview.h @@ -34,8 +34,8 @@ typedef struct { lv_dir_t dir; } lv_tileview_tile_t; -extern const lv_obj_class_t lv_tileview_class; -extern const lv_obj_class_t lv_tileview_tile_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_tileview_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_tileview_tile_class; /********************** * GLOBAL PROTOTYPES diff --git a/src/widgets/win/lv_win.h b/src/widgets/win/lv_win.h index bcebed8416..ab7b386612 100644 --- a/src/widgets/win/lv_win.h +++ b/src/widgets/win/lv_win.h @@ -26,7 +26,7 @@ typedef struct { lv_obj_t obj; } lv_win_t; -extern const lv_obj_class_t lv_win_class; +LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_win_class; /********************** * GLOBAL PROTOTYPES