init() is private in this context

i keep getting this error. ive attached the code and library

Arduino: 1.8.12 (Mac OS X), Board: “Arduino Uno”

/Users/alex/Downloads/humtemp/humtemp.ino: In function ‘void setup()’:
humtemp:26:14: error: ‘int LiquidCrystal_I2C::init()’ is private within this context
lcd.init(); // initialize the lcd

^
In file included from /Users/alex/Downloads/humtemp/humtemp.ino:11:0:
/Users/alex/Documents/Arduino/libraries/NewliquidCrystal/LiquidCrystal_I2C.h:154:9: note: declared private here
int init();
^~~~
exit status 1
‘int LiquidCrystal_I2C::init()’ is private within this context

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

humtemp.ino (1.72 KB)

LiquidCrystal_I2C.h (8.04 KB)

‘int LiquidCrystal_I2C::init()’ is private within this context

private:
   
   /*!
    @method     
    @abstract   Initializes the LCD class
    @discussion Initializes the LCD class and IO expansion module.
    */
   int  init();

Well, the compiler isn’t lying

Did you perhaps mean to use the begin() method ?

UKHeliBob: private:     /*!    @method        @abstract   Initializes the LCD class    @discussion Initializes the LCD class and IO expansion module.    */   int  init();

Well, the compiler isn't lying

Did you perhaps mean to use the begin() method ?

i tried using lcd.begin() but it tells me no matching function for call to 'LiquidCrystal_I2C::begin()'

What parameters did you use in begin() ?

From the library file that you attached

    The begin method can be overloaded if necessary to initialize any HW that 
    is implemented by a library and can't be done during construction, here
    we use the Wire class.
    
    @param      cols[in] the number of columns that the display has
    @param      rows[in] the number of rows that the display has
    @param      charsize[in] size of the characters of the LCD: LCD_5x8DOTS or
    LCD_5x10DOTS.
    */
   virtual void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS);

Are there any examples with the library ?

UKHeliBob: What parameters did you use in begin() ?

From the library file that you attached

    The begin method can be overloaded if necessary to initialize any HW that 
    is implemented by a library and can't be done during construction, here
    we use the Wire class.
    
    @param      cols[in] the number of columns that the display has
    @param      rows[in] the number of rows that the display has
    @param      charsize[in] size of the characters of the LCD: LCD_5x8DOTS or
    LCD_5x10DOTS.
    */
   virtual void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS);

Are there any examples with the library ?

i dont remember which parameters i tried im using this https://create.arduino.cc/projecthub/adrakhmat/temperature-monitor-with-dht22-and-i2c-16x2-lcd-3ddd39?f=1#comments since thats what im making

i new to all of this

The code that you linked to uses the init() method which I assume means that the library you are using is not the same as the one used by the code.

UKHeliBob:
The code that you linked to uses the init() method which I assume means that the library you are using is not the same as the one used by the code.

the website i linked has a link to instructions which has a link to the library its the only library link he said to use

UKHeliBob: The code that you linked to uses the init() method which I assume means that the library you are using is not the same as the one used by the code.

i found a different library and it seems to work thank you