Fix “no matching function for call to 'LiquidCrystal_I2C::begin()'”
The code was written for a different LCD library. With Frank de Brabander’s LiquidCrystal I2C, call lcd.init() (or lcd.begin(16, 2)) instead of lcd.begin().
Community draft — report a mistake
What you see
LcdHello.ino: In function 'void setup()':
LcdHello.ino:5:13: error: no matching function for call to 'LiquidCrystal_I2C::begin()'
lcd.begin();
^
In file included from LcdHello.ino:2:0:
libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:8: note: candidate: void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t)
void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS );
^~~~~
libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:8: note: candidate expects 3 arguments, 0 provided
exit status 1
Compilation error: no matching function for call to 'LiquidCrystal_I2C::begin()'LcdHello.ino: In function 'void setup()':
LcdHello.ino:5:13: error: no matching function for call to 'LiquidCrystal_I2C::begin()'
lcd.begin();
^
In file included from LcdHello.ino:2:0:
libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:8: note: candidate: void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t)
void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS );
^~~~~
libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:8: note: candidate expects 3 arguments, 0 provided
exit status 1
Compilation error: no matching function for call to 'LiquidCrystal_I2C::begin()'
The compiler’s candidate list says the installed library has begin(cols, rows, charsize) — and no begin() without arguments. Your code came from a tutorial that used another LiquidCrystal_I2C library.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
lcd.init(); // instead of lcd.begin();
lcd.backlight();
lcd.print("Hello");
}Quick fix — try in order
- 1
Use lcd.init()
Replace
lcd.begin();withlcd.init();, thenlcd.backlight();. The size is already set in the constructorLiquidCrystal_I2C lcd(0x27, 16, 2);. - 2
Or pass the size to begin()
lcd.begin(16, 2);also matches the candidate the compiler lists. - 3
Check the constructor style
Code like
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);is for the NewLiquidCrystal library (F. Malpartida) — a different library with the same header name. - 4
Keep only one LCD library
Several libraries ship a LiquidCrystal_I2C.h. Remove the ones you don’t use so the IDE can’t pick the wrong one.
Why it happens
Why do examples differ?
At least three Arduino libraries are called LiquidCrystal_I2C. Some have begin() without arguments; Frank de Brabander’s (the one in the Library Manager) has init() and begin(cols, rows).
Compiles but screen is blank or shows blocks
Then the code is fine and the issue is address or contrast — see LCD shows blocks or blank.
Prints only one letter
Old copy of the library — see LCD prints only the first character.
Board-specific notes
Arduino Uno: Tested sketch and wiring: 16×2 I2C LCD with Uno.
Parts: 16×2 I2C LCD — addresses 0x27 / 0x3F.
Did this fix it?
Thanks — that helps us keep this page right.