PlatformIO Community

PIO Optional Parameter not working, on arduino working fine

Hi guys,
Optional Parameter not working on PIO but on arduino it’s working fine.
This is the error:
In function global constructors keyed to 65535_0_main.cpp.o.2165': <artificial>:(.text.startup+0x2d8): undefined reference toLiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\uno\firmware.elf] Error 1

These is the imlementation
LiquidCrystal_I2C(uint8_t lcd_addr, uint8_t lcd_cols, uint8_t lcd_rows, uint8_t charsize =
LCD_5x8DOTS);
as you can see the 4th parameter is optional.
Main.cpp
LiquidCrystal_I2C lcd(0x27,16,2);

Can you provide a minimal reproducible example (platformio.ini, minimal main.cpp) and more information about your environment?

I doubt it has anything to do with optional parameters. Arduino IDE and PlatformIO use the same compilers and linkers.

1 Like