0
votes

I am trying to use https://github.com/sudar/Arduino-Makefile for Arduino on Raspberry Pi with some user cpp libraries but it can not compile and show the error below.

/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -mmcu=atmega2560 -Wl,--gc-sections -Os -flto -fuse-linker-plugin -o build-mega-atmega2560/toprint.elf build-mega-atmega2560/toprint.ino.o build-mega-atmega2560/libcore.a -lc -lm /tmp/cc1J77Gh.ltrans0.ltrans.o: In function main': <artificial>:(.text.startup+0x4be): undefined reference to Str2let::~Str2let()' collect2: error: ld returned 1 exit status make: *** [/home/pi/Desktop/demo1_may9/Arduino/toprint/Arduino-Makefile/Arduino.mk:1673: build-mega-atmega2560/toprint.elf] Error 1

My configuration file is as

ARDUINO_DIR   = /usr/share/arduino 
MONITOR_PORT  = /dev/ttyACM* 
USER_LIB_PATH = /home/pi/sketchbook/libraries

#BOARD_SUB   = mega2560 #replaced by below 
MCU = atmega2560

# Define Atmega2560 
BOARD_TAG    = mega 
BOARD_SUB    = atmega2560

AVRDUDE      = /usr/share/arduino/hardware/tools/avr

include /home/pi/Desktop/demo1_may9/Arduino/toprint/Arduino-Makefile/Arduino.mk Does anyone know what happened?

The same code can run on Mac but just not Pi.

1

1 Answers

0
votes

solved it by using the case[2] in this post. Just don't define the USER_LIB_PATH and put all the files in the same location as .ino and Makefile.