You either have the wrong library or don't have it properly installed.
For that LiquidCrystal_I2C constructor, you need this library:
https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
I have LiquidCrystal_V1.2.1 installed and use it in other sketches.
If I change the above example with "LiquidCrystal_I2C lcd(0x27, 20, 4);", which works for me it highlights the following line.
m2_SetNewLiquidCrystal(&lcd, 16, 2);
And gives the error -
Arduino: 1.5.6-r2 (Windows 7), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
Build options changed, rebuilding all
Using library Wire in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire (legacy)
Using library LiquidCrystal_I2C in folder: C:\Users\KB0NRK\Documents\Arduino\libraries\LiquidCrystal_I2C (legacy)
Using library M2tk in folder: C:\Users\KB0NRK\Documents\Arduino\libraries\M2tk (legacy)
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire -IC:\Users\KB0NRK\Documents\Arduino\libraries\LiquidCrystal_I2C -IC:\Users\KB0NRK\Documents\Arduino\libraries\M2tk C:\Users\KB0NRK\AppData\Local\Temp\build1579395692306476180.tmp\MenuX2L.cpp -o C:\Users\KB0NRK\AppData\Local\Temp\build1579395692306476180.tmp\MenuX2L.cpp.o
In file included from MenuX2L.ino:4:
C:\Users\KB0NRK\Documents\Arduino\libraries\M2tk/utility/m2ghnlc.h:32: error: variable or field 'm2_SetNewLiquidCrystal' declared void
C:\Users\KB0NRK\Documents\Arduino\libraries\M2tk/utility/m2ghnlc.h:32: error: 'LCD' was not declared in this scope
C:\Users\KB0NRK\Documents\Arduino\libraries\M2tk/utility/m2ghnlc.h:32: error: 'lc_ptr' was not declared in this scope
C:\Users\KB0NRK\Documents\Arduino\libraries\M2tk/utility/m2ghnlc.h:32: error: expected primary-expression before 'cols'
C:\Users\KB0NRK\Documents\Arduino\libraries\M2tk/utility/m2ghnlc.h:32: error: expected primary-expression before 'rows'
MenuX2L.ino: In function 'void setup()':
MenuX2L.ino:13: error: 'm2_SetNewLiquidCrystal' was not declared in this scope
As you can see I am new to this and need working codeto learn from.
Thanks Earl