sudar / Arduino-Makefile

Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.
http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile
GNU Lesser General Public License v2.1
2.01k stars 448 forks source link

linker issues with Teensy, FastLED and Audio libs #650

Closed Genoil closed 3 years ago

Genoil commented 3 years ago

I am using FastLED in my project on a Teensy3.6 but it fails to build. Within the context of my project I get this error:

build-teensy36/libcore.a(new.cpp.o): In function `operator delete(void*)':
new.cpp:(.text._ZdlPv+0x0): multiple definition of `operator delete(void*)'
/Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++.a(del_op.o):del_op.cc:(.text._ZdlPv+0x0): first defined here
/Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: Disabling relaxation: it will not work with multiple definitions
collect2: error: ld returned 1 exit status
make: *** [build-teensy36/LEDHandle.elf] Error 1

I decided to isolate the issue by trying to build a sketch with just this in it:

#include <FastLED.h>

void setup() { 
    CRGB leds[10];
    FastLED.addLeds<NEOPIXEL, 3>(leds, 10);  // GRB ordering is assumed
}

void loop() { 
}

and now I get:

/Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/fpu/libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text._write_r+0x12): undefined reference to `_write'
collect2: error: ld returned 1 exit status
make: *** [build-teensy36/FastLEDTest.elf] Error 1

any clue what is going on? i can do succesful builds with other libs, but with FastLED (and also with the Teensy Audio libraries), I get similar ld errors.

Genoil commented 3 years ago

i ended up just commenting out all of new.cpp in cores/teensy3. that resolved the issue.

Genoil commented 3 years ago

https://github.com/sudar/Arduino-Makefile/issues/655