Marlin firmware, 'init' is not a member of 'U8GLIB'

I'm trying to compile marlin-2.0.x firmware with RepRapDiscount Full Graphic Smart Controller. But stuck with this error. Both u8glib 1.8 and 1.9

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.

We cannot see your code

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 when posting code , use code tags and post the code here

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.

Still can't see your code

Im seeing the same errors for the same issue below is the sections of code Im hoping your looking for as Id like to get it fixed too from file
HAL_LCD_class_Defines.h

extern u8g_dev_t u8g_dev_ssd1309_sw_spi;
extern u8g_dev_t u8g_dev_ssd1309_hw_spi;

class U8GLIB_SSD1309_128X64_HAL : public U8GLIB {
public:
U8GLIB_SSD1309_128X64_HAL() : U8GLIB() { }
U8GLIB_SSD1309_128X64_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { init(sck, mosi, cs, a0, reset); }
U8GLIB_SSD1309_128X64_HAL(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { init(cs, a0, reset); }
void init(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) {
U8GLIB::init(&u8g_dev_ssd1309_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset);
}
void init(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) {
U8GLIB::init(&u8g_dev_ssd1309_hw_spi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset);
}
};

Wrong

I was asking for the whole code

thanks for all repply. everything work fine after downgraded marlin firmware to 2.0.7.2

I am having the same issue as well. Same exact error list. @UKHeliBob Unfortunately the code that @dudidam is referring to is a very large code (6000+ lines in the config files alone.) and is unreasonable to post here. I am trying to find solutions without having to downgrade versions my self. A possible solution is that Marlin is not recognizing the correct U8GLIB library make sure the library you have is U8GLIB-HAL (Note how its referencing the *_HAL::init.