</> Marlin 2.0 does not compile while I define Display

When I compile the Marlin 2.0 to Arduino mega, This error will occur.

Display using (define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
RAMPS 1.4 with Arduino MEGA

Marlin 2.0


Arduino: 1.8.14 Hourly Build 2021/04/09 02:33 (Windows 10), Board: “Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)”

In file included from sketch\src\lcd\dogm/marlinui_DOGM.h:31:0,

             from sketch\src\lcd\marlinui.cpp:126:

sketch\src\lcd\dogm/HAL_LCD_class_defines.h: In member function ‘void U8GLIB_64128N_2X_HAL::init(pin_t, pin_t, pin_t, pin_t, pin_t)’:

sketch\src\lcd\dogm/HAL_LCD_class_defines.h:37:13: error: ‘init’ is not a member of ‘U8GLIB’

 U8GLIB::init(&u8g_dev_st7565_64128n_HAL_2x_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset);

         ^~~~

sketch\src\lcd\dogm/HAL_LCD_class_defines.h: In member function ‘void U8GLIB_64128N_2X_HAL::init(pin_t, pin_t, pin_t)’:

sketch\src\lcd\dogm/HAL_LCD_class_defines.h:40:13: error: ‘init’ is not a member of ‘U8GLIB’

 U8GLIB::init(&u8g_dev_st7565_64128n_HAL_2x_hw_spi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset);

         ^~~~

sketch\src\lcd\dogm/HAL_LCD_class_defines.h: In member function ‘void U8GLIB_ST7920_128X64_4X_HAL::init(pin_t, pin_t, pin_t, pin_t)’:

sketch\src\lcd\dogm/HAL_LCD_class_defines.h:53:13: error: ‘init’ is not a member of ‘U8GLIB’

 U8GLIB::init(&u8g_dev_st7920_128x64_HAL_4x_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset); // a0 = U8G_PIN_NONE

         ^~~~

sketch\src\lcd\dogm/HAL_LCD_class_defines.h: In member function ‘void U8GLIB_ST7920_128X64_4X_HAL::init(pin_t, pin_t)’:

sketch\src\lcd\dogm/HAL_LCD_class_defines.h:56:13: error: ‘init’ is not a member of ‘U8GLIB’

 U8GLIB::init(&u8g_dev_st7920_128x64_HAL_4x_hw_spi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset); // a0 = U8G_PIN_NONE

         ^~~~

sketch\src\lcd\dogm/HAL_LCD_class_defines.h: In member function ‘void U8GLIB_ST7920_128X64_RRD::init(pin_t, pin_t, pin_t, pin_t)’:

sketch\src\lcd\dogm/HAL_LCD_class_defines.h:71:13: error: ‘init’ is not a member of ‘U8GLIB’

 U8GLIB::init(&u8g_dev_st7920_128x64_rrd_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset);   // a0 = U8G_PIN_NONE

         ^~~~

sketch\src\lcd\dogm/HAL_LCD_class_defines.h: In member function ‘void U8GLIB_SH1106_128X64_2X_I2C_2_WIRE::init(uint8_t)’:

sketch\src\lcd\dogm/HAL_LCD_class_defines.h:81:59: error: ‘init’ is not a member of ‘U8GLIB’

void init(uint8_t options = U8G_I2C_OPT_NONE) { U8GLIB::init(&u8g_dev_sh1106_128x64_2x_i2c_2_wire, options); }

                                                       ^~~~

sketch\src\lcd\dogm/HAL_LCD_class_defines.h: In member function ‘void U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE::init(uint8_t)’:

sketch\src\lcd\dogm/HAL_LCD_class_defines.h:90:59: error: ‘init’ is not a member of ‘U8GLIB’

void init(uint8_t options = U8G_I2C_OPT_NONE) { U8GLIB::init(&u8g_dev_ssd1306_128x64_2x_i2c_2_wire, options); }

                                                       ^~~~

sketch\src\lcd\dogm/HAL_LCD_class_defines.h: In member function ‘void U8GLIB_TFT_320X240_UPSCALE_FROM_128X64::init(uint8_t, uint8_t, uint8_t)’:

sketch\src\lcd\dogm/HAL_LCD_class_defines.h:103:77: error: ‘init’ is not a member of ‘U8GLIB’

void init(uint8_t cs, uint8_t rs, uint8_t reset = U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_tft_320x240_upscale_from_128x64, cs, rs, reset); }

                                                                         ^~~~

sketch\src\lcd\dogm/HAL_LCD_class_defines.h: In member function ‘void U8GLIB_MINI12864_2X_HAL::init(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)’:

sketch\src\lcd\dogm/HAL_LCD_class_defines.h:115:13: error: ‘init’ is not a member of ‘U8GLIB’

 U8GLIB::init(&u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, sck, mosi, cs, a0, reset);

         ^~~~

sketch\src\lcd\dogm/HAL_LCD_class_defines.h: In member function ‘void U8GLIB_MINI12864_2X_HAL::init(uint8_t, uint8_t, uint8_t)’:

sketch\src\lcd\dogm/HAL_LCD_class_defines.h:118:13: error: ‘init’ is not a member of ‘U8GLIB’

 U8GLIB::init(&u8g_dev_uc1701_mini12864_HAL_2x_hw_spi, cs, a0, reset);

         ^~~~

sketch\src\lcd\dogm/HAL_LCD_class_defines.h: In member function ‘void U8GLIB_SSD1309_128X64_HAL::init(pin_t, pin_t, pin_t, pin_t, pin_t)’:

sketch\src\lcd\dogm/HAL_LCD_class_defines.h:131:13: error: ‘init’ is not a member of ‘U8GLIB’

 U8GLIB::init(&u8g_dev_ssd1309_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset);

         ^~~~

sketch\src\lcd\dogm/HAL_LCD_class_defines.h: In member function ‘void U8GLIB_SSD1309_128X64_HAL::init(pin_t, pin_t, pin_t)’:

sketch\src\lcd\dogm/HAL_LCD_class_defines.h:134:13: error: ‘init’ is not a member of ‘U8GLIB’

 U8GLIB::init(&u8g_dev_ssd1309_hw_spi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset);

         ^~~~

exit status 1

Error compiling for board Arduino Mega or Mega 2560.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

The easier you make it to read and copy the code the more likely it is that you will get help

Please follow the advice given in the link below and post your complete sketch so that the errors can be seen in context