Undefined reference to `rgb_lcd::begin(unsigned char, unsigned char, unsigned char, TwoWire&)'

Hello,

I'm trying to compile and upload the following sketch to an arduino Nano from Raspberry Pi. When I try it with the IDE it works fine, but when I try to compile and upload from Terminal it crashes.

This is the sketch:

#include <Wire.h> 

/*
#include <LiquidCrystal_I2C.h>

// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
*/

#include "libraries/Grove_LCD_RGB_Backlight-master/rgb_lcd.h"
rgb_lcd lcd;

int index=1;


  char msg[][15] = {
    "Set Board Id  ",
    "Sensor tunning",
    "Target Press. "
  };

/*

  char msg[][16] = {
    "Set Board Id   ",
    "Sensor tunning ",
    "Target Pressure"
  };
*/

uint8_t empty[8] = {0x1F,0x11,0x11,0x11,0x11,0x11,0x11,0x1F};
//uint8_t selected[8] = {0x1F,0x0E,0x15,0x1B,0x1B,0x15,0x0E,0x1F};
byte selected[8] = {
  0b11111,
  0b11111,
  0b11011,
  0b10101,
  0b10101,
  0b11011,
  0b11111,
  0b11111
};


int count = 1;
int msgIdx = 0;
void setup()
{
    Serial.begin(9600);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(A0, INPUT_PULLUP);
  
  delay(200);
  // initialize the LCD
  //lcd.begin();
  lcd.begin(16,2);
  delay(200);
  lcd.clear();
  
  
  lcd.createChar(1,empty);
  lcd.createChar(2,selected);
  
  // Turn on the blacklight and print a message.
  //lcd.backlight();
  
}

void loop()
{
  if(digitalRead(6) == LOW){
    msgIdx = (msgIdx + 1)%3;
  }

  if(digitalRead(7) == LOW){
    msgIdx = (msgIdx + 2)%3;
  }

  Serial.print("Idx = ");
  Serial.println(msgIdx);
  
    
  if(index==1){
    lcd.setCursor(0, 0);
    lcd.print(msgIdx+1);
    lcd.setCursor(1, 0);
    lcd.print("-");
    lcd.setCursor(2, 0);
  }else{
    lcd.setCursor(0, 0);
  }
  
  lcd.print(msg[msgIdx]);
  for(int i =0; i <3;i++){
    lcd.setCursor(i+6, 1);  
    lcd.write(1);
  }
  
  lcd.setCursor(msgIdx+6, 1);
  lcd.write(2);
  
  
  //lcd.setCursor(2, 1);
  //lcd.print(msg[(msgIdx+1)%3]);

  
  if(digitalRead(A0)==false){
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.write("PROGRAMMING ...");
  }
  
  delay(200);
}

As I said, it works fine with the IDE. But when I compile it and upload from the Terminal I get the error.

The only code difference to make it work on the IDE is the #include statement.

Working on the IDE it is:

#include "rgb_lcd.h"

And to run on the Terminal and avoid complains of not finding the library, the include has to be:

#include "libraries/Grove_LCD_RGB_Backlight-master/rgb_lcd.h"

The error/output I get in the Terminal is as follows:

pi@RPi-3:~/testMenu $ make upload clean
-------------------------
Arduino.mk Configuration:
- [AUTODETECTED]       CURRENT_OS = LINUX 
- [USER]               ARDUINO_DIR = /usr/share/arduino 
- [COMPUTED]           ARDMK_DIR = /usr/share/arduino (relative to Common.mk)
- [AUTODETECTED]       ARDUINO_VERSION = 105 
- [DEFAULT]            ARCHITECTURE =  
- [DEFAULT]            ARDMK_VENDOR = arduino 
- [DEFAULT]            ARDUINO_SKETCHBOOK =  
- [BUNDLED]            AVR_TOOLS_DIR = /usr/share/arduino/hardware/tools/avr (in Arduino distribution)
- [COMPUTED]           ARDUINO_LIB_PATH = /usr/share/arduino/libraries (from ARDUINO_DIR)
- [COMPUTED]           ARDUINO_VAR_PATH = /usr/share/arduino/hardware/arduino//variants (from ARDUINO_DIR)
- [COMPUTED]           BOARDS_TXT = /usr/share/arduino/hardware/arduino//boards.txt (from ARDUINO_DIR)
- [DEFAULT]            USER_LIB_PATH = /libraries (in user sketchbook)
- [DEFAULT]            PRE_BUILD_HOOK = pre-build-hook.sh 
- [USER]               BOARD_SUB = atmega328 
- [USER]               BOARD_TAG = nano328 
- [COMPUTED]           CORE = arduino (from build.core)
- [COMPUTED]           VARIANT = eightanaloginputs (from build.variant)
- [COMPUTED]           OBJDIR = build-nano328-atmega328 (from BOARD_TAG)
- [COMPUTED]           ARDUINO_CORE_PATH = /usr/share/arduino/hardware/arduino//cores/arduino (from ARDUINO_DIR, BOARD_TAG and boards.txt)
- [DETECTED]           MONITOR_BAUDRATE = 9600  (in sketch)
- [DEFAULT]            OPTIMIZATION_LEVEL = s 
- [DEFAULT]            MCU_FLAG_NAME = mmcu 
- [DEFAULT]            CFLAGS_STD = -std=gnu11 -flto -fno-fat-lto-objects 
- [DEFAULT]            CXXFLAGS_STD = -std=gnu++11 -fno-threadsafe-statics -flto 
- [COMPUTED]           DEVICE_PATH = /dev/ttyUSB* (from MONITOR_PORT)
- [DEFAULT]            FORCE_MONITOR_PORT =  
- [AUTODETECTED]       Size utility: AVR-aware for enhanced output
-
-                      ARDUINO_LIBS =
- [SYSTEM]               Wire
- [COMPUTED]           BOOTLOADER_PARENT = /usr/share/arduino/hardware/arduino//bootloaders (from ARDUINO_DIR)
- [COMPUTED]           ARDMK_VERSION = 1.5 
- [COMPUTED]           CC_VERSION = 5.4.0 (avr-gcc)
-------------------------
mkdir -p build-nano328-atmega328
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -x c++ -include Arduino.h -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto testMenu.ino -o build-nano328-atmega328/testMenu.ino.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -std=gnu11 -flto -fno-fat-lto-objects /usr/share/arduino/hardware/arduino//cores/arduino/wiring.c -o build-nano328-atmega328/core/wiring.c.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -std=gnu11 -flto -fno-fat-lto-objects /usr/share/arduino/hardware/arduino//cores/arduino/WInterrupts.c -o build-nano328-atmega328/core/WInterrupts.c.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -std=gnu11 -flto -fno-fat-lto-objects /usr/share/arduino/hardware/arduino//cores/arduino/wiring_digital.c -o build-nano328-atmega328/core/wiring_digital.c.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -std=gnu11 -flto -fno-fat-lto-objects /usr/share/arduino/hardware/arduino//cores/arduino/wiring_pulse.c -o build-nano328-atmega328/core/wiring_pulse.c.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -std=gnu11 -flto -fno-fat-lto-objects /usr/share/arduino/hardware/arduino//cores/arduino/wiring_analog.c -o build-nano328-atmega328/core/wiring_analog.c.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -std=gnu11 -flto -fno-fat-lto-objects /usr/share/arduino/hardware/arduino//cores/arduino/wiring_shift.c -o build-nano328-atmega328/core/wiring_shift.c.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -std=gnu11 -flto -fno-fat-lto-objects /usr/share/arduino/hardware/arduino//cores/arduino/avr-libc/realloc.c -o build-nano328-atmega328/core/avr-libc/realloc.c.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -std=gnu11 -flto -fno-fat-lto-objects /usr/share/arduino/hardware/arduino//cores/arduino/avr-libc/malloc.c -o build-nano328-atmega328/core/avr-libc/malloc.c.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto /usr/share/arduino/hardware/arduino//cores/arduino/IPAddress.cpp -o build-nano328-atmega328/core/IPAddress.cpp.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto /usr/share/arduino/hardware/arduino//cores/arduino/new.cpp -o build-nano328-atmega328/core/new.cpp.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto /usr/share/arduino/hardware/arduino//cores/arduino/WString.cpp -o build-nano328-atmega328/core/WString.cpp.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto /usr/share/arduino/hardware/arduino//cores/arduino/Tone.cpp -o build-nano328-atmega328/core/Tone.cpp.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto /usr/share/arduino/hardware/arduino//cores/arduino/Print.cpp -o build-nano328-atmega328/core/Print.cpp.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto /usr/share/arduino/hardware/arduino//cores/arduino/HID.cpp -o build-nano328-atmega328/core/HID.cpp.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto /usr/share/arduino/hardware/arduino//cores/arduino/Stream.cpp -o build-nano328-atmega328/core/Stream.cpp.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto /usr/share/arduino/hardware/arduino//cores/arduino/USBCore.cpp -o build-nano328-atmega328/core/USBCore.cpp.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto /usr/share/arduino/hardware/arduino//cores/arduino/WMath.cpp -o build-nano328-atmega328/core/WMath.cpp.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto /usr/share/arduino/hardware/arduino//cores/arduino/main.cpp -o build-nano328-atmega328/core/main.cpp.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto /usr/share/arduino/hardware/arduino//cores/arduino/HardwareSerial.cpp -o build-nano328-atmega328/core/HardwareSerial.cpp.o
/usr/share/arduino/hardware/arduino//cores/arduino/HardwareSerial.cpp: In function ‘void store_char(unsigned char, ring_buffer*)’:
/usr/share/arduino/hardware/arduino//cores/arduino/HardwareSerial.cpp:100:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (i != buffer->tail) {
         ^
/usr/share/arduino/hardware/arduino//cores/arduino/HardwareSerial.cpp: In function ‘void __vector_18()’:
/usr/share/arduino/hardware/arduino//cores/arduino/HardwareSerial.cpp:129:21: warning: unused variable ‘c’ [-Wunused-variable]
       unsigned char c = UDR0;
                     ^
/usr/share/arduino/hardware/arduino//cores/arduino/HardwareSerial.cpp: In member function ‘void HardwareSerial::begin(long unsigned int, byte)’:
/usr/share/arduino/hardware/arduino//cores/arduino/HardwareSerial.cpp:370:11: warning: unused variable ‘current_config’ [-Wunused-variable]
   uint8_t current_config;
           ^
/usr/share/arduino/hardware/arduino//cores/arduino/HardwareSerial.cpp: In member function ‘virtual size_t HardwareSerial::write(uint8_t)’:
/usr/share/arduino/hardware/arduino//cores/arduino/HardwareSerial.cpp:469:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while (i == _tx_buffer->tail)
            ^
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto /usr/share/arduino/hardware/arduino//cores/arduino/CDC.cpp -o build-nano328-atmega328/core/CDC.cpp.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -std=gnu11 -flto -fno-fat-lto-objects /usr/share/arduino/libraries/Wire/utility/twi.c -o build-nano328-atmega328/libs/Wire/utility/twi.c.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/usr/share/arduino/hardware/arduino//variants/eightanaloginputs    -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility   -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto /usr/share/arduino/libraries/Wire/Wire.cpp -o build-nano328-atmega328/libs/Wire/Wire.cpp.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc-ar rcs build-nano328-atmega328/libcore.a  build-nano328-atmega328/core/wiring.c.o  build-nano328-atmega328/core/WInterrupts.c.o  build-nano328-atmega328/core/wiring_digital.c.o  build-nano328-atmega328/core/wiring_pulse.c.o  build-nano328-atmega328/core/wiring_analog.c.o  build-nano328-atmega328/core/wiring_shift.c.o  build-nano328-atmega328/core/avr-libc/realloc.c.o  build-nano328-atmega328/core/avr-libc/malloc.c.o  build-nano328-atmega328/core/IPAddress.cpp.o  build-nano328-atmega328/core/new.cpp.o  build-nano328-atmega328/core/WString.cpp.o  build-nano328-atmega328/core/Tone.cpp.o  build-nano328-atmega328/core/Print.cpp.o  build-nano328-atmega328/core/HID.cpp.o  build-nano328-atmega328/core/Stream.cpp.o  build-nano328-atmega328/core/USBCore.cpp.o  build-nano328-atmega328/core/WMath.cpp.o  build-nano328-atmega328/core/main.cpp.o  build-nano328-atmega328/core/HardwareSerial.cpp.o  build-nano328-atmega328/core/CDC.cpp.o build-nano328-atmega328/libs/Wire/utility/twi.c.o build-nano328-atmega328/libs/Wire/Wire.cpp.o     
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -mmcu=atmega328p -Wl,--gc-sections -Os -flto -fuse-linker-plugin -o build-nano328-atmega328/testMenu.elf build-nano328-atmega328/testMenu.ino.o build-nano328-atmega328/libcore.a   -lc -lm 
/tmp/ccHFXlaR.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_testMenu.ino.o.2056':
<artificial>:(.text.startup+0x90): undefined reference to `rgb_lcd::rgb_lcd()'
/tmp/ccHFXlaR.ltrans0.ltrans.o: In function `main':
<artificial>:(.text.startup+0x1fa): undefined reference to `rgb_lcd::begin(unsigned char, unsigned char, unsigned char, TwoWire&)'
<artificial>:(.text.startup+0x206): undefined reference to `rgb_lcd::clear()'
<artificial>:(.text.startup+0x214): undefined reference to `rgb_lcd::createChar(unsigned char, unsigned char*)'
<artificial>:(.text.startup+0x222): undefined reference to `rgb_lcd::createChar(unsigned char, unsigned char*)'
<artificial>:(.text.startup+0x2c0): undefined reference to `rgb_lcd::setCursor(unsigned char, unsigned char)'
<artificial>:(.text.startup+0x2f8): undefined reference to `rgb_lcd::setCursor(unsigned char, unsigned char)'
<artificial>:(.text.startup+0x310): undefined reference to `rgb_lcd::setCursor(unsigned char, unsigned char)'
<artificial>:(.text.startup+0x33c): undefined reference to `rgb_lcd::setCursor(unsigned char, unsigned char)'
<artificial>:(.text.startup+0x346): undefined reference to `rgb_lcd::write(unsigned char)'
<artificial>:(.text.startup+0x35c): undefined reference to `rgb_lcd::setCursor(unsigned char, unsigned char)'
<artificial>:(.text.startup+0x366): undefined reference to `rgb_lcd::write(unsigned char)'
<artificial>:(.text.startup+0x378): undefined reference to `rgb_lcd::clear()'
<artificial>:(.text.startup+0x384): undefined reference to `rgb_lcd::setCursor(unsigned char, unsigned char)'
collect2: error: ld returned 1 exit status
make: *** [/usr/share/arduino/Arduino.mk:1442: build-nano328-atmega328/testMenu.elf] Error 1

I've tried to look for the string "begin(unsigned char" in /usr/share/arduino/ but I can't find anywhere it is declared or used.

So I have no idea who is trying to use it.

The folder tree of the sketch is as follows:

sketchFolder
  |--  Makefile
  |--  testMenu.ino
  |--  libraries/
             |-- Grove_LCD_RGB_Backlight-master/
                                  |--  examples/
                                  |--  rgb_lcd.cpp
                                  |--  rgb_lcd.h

So the questions are:

  1. What are the differences when compiling and uploading with the IDE and Terminal ?
  2. How can I solve this issue and who is trying to use this weird function call.

Thanks you in advance.

#include <Wire.h> 

/*
#include <LiquidCrystal_I2C.h>

// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
*/

#include "rgb_lcd.h"
rgb_lcd lcd;

int index=1;


  char msg[][15] = {
    "Set Board Id  ",
    "Sensor tunning",
    "Target Press. "
  };

/*

  char msg[][16] = {
    "Set Board Id   ",
    "Sensor tunning ",
    "Target Pressure"
  };
*/

uint8_t empty[8] = {0x1F,0x11,0x11,0x11,0x11,0x11,0x11,0x1F};
//uint8_t selected[8] = {0x1F,0x0E,0x15,0x1B,0x1B,0x15,0x0E,0x1F};
byte selected[8] = {
  0b11111,
  0b11111,
  0b11011,
  0b10101,
  0b10101,
  0b11011,
  0b11111,
  0b11111
};


int count = 1;
int msgIdx = 0;
void setup()
{
    Serial.begin(9600);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(A0, INPUT_PULLUP);
  
  delay(200);
  // initialize the LCD
  //lcd.begin();
  lcd.begin(16,2);
  delay(200);
  lcd.clear();
  
  
  lcd.createChar(1,empty);
  lcd.createChar(2,selected);
  
  // Turn on the blacklight and print a message.
  //lcd.backlight();
  
}

void loop()
{
  if(digitalRead(6) == LOW){
    msgIdx = (msgIdx + 1)%3;
  }

  if(digitalRead(7) == LOW){
    msgIdx = (msgIdx + 2)%3;
  }

  Serial.print("Idx = ");
  Serial.println(msgIdx);
  
    
  if(index==1){
    lcd.setCursor(0, 0);
    lcd.print(msgIdx+1);
    lcd.setCursor(1, 0);
    lcd.print("-");
    lcd.setCursor(2, 0);
  }else{
    lcd.setCursor(0, 0);
  }
  
  lcd.print(msg[msgIdx]);
  for(int i =0; i <3;i++){
    lcd.setCursor(i+6, 1);  
    lcd.write(1);
  }
  
  lcd.setCursor(msgIdx+6, 1);
  lcd.write(2);
  
  
  //lcd.setCursor(2, 1);
  //lcd.print(msg[(msgIdx+1)%3]);

  
  if(digitalRead(A0)==false){
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.write("PROGRAMMING ...");
  }
  
  delay(200);
}

hello @kolaha thanks for the response.

I guess you're proposing to change the #include statement, right?

As I mentioned in the post, that works if compiling in the IDE, but it doesn't work when compiling and uploading in the Terminal on Raspberry Pi using the make upload. It complains about not finding the rgb_lcd.h file. The only way it seems to find it and proceed is with the #include statement with the path specified.

I can't test it now, but initially I had the rgb_lcd library in the /usr/share/arduino/library directory as the rest of libraries. But the sketch couldn't find the library neither there. That's why I moved to the local directory of the sketch.

#include <rgb_lcd.h>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.