Arduino compilation error undefined reference to `__cxa_guard_acquire'

Status
Not open for further replies.

stb

New member
While trying to get one of the samples from FastLED to work, I ran into a compilation error when targeting Teensy 2.0, but not (for example) an Uno.

Code:
ledtest.cpp.o: In function `CLEDController* CFastLED::addLeds<(EClocklessChipsets)4, (unsigned char)3, (EOrder)10>(CRGB const*, int, int)':
/Users/stb/Documents/Arduino/libraries/FastLED/FastLED.h:120: undefined reference to `__cxa_guard_acquire'
/Users/stb/Documents/Arduino/libraries/FastLED/FastLED.h:120: undefined reference to `__cxa_guard_release'

After some googling, I discovered that new.cpp for the Teensy (/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy/new.cpp) has those functions commented out. It seems that this is the only difference between this and the Arduino new.cpp, so I remove the comments, and the compilation succeeds.

Is this a bug, or where would those symbols normally be supplied from?
 
First, please make sure you have the latest Teensyduino version installed, 1.18-rc2. A very similar bug was fixed some time ago.

If that doesn't work, please post a link to this library, and if this isn't one of the examples from the library, please post the code that reproduces this problem.

I can only look into this if you give me enough info to recreate the problem here.
 
I just reported similar compile error when compiling Ethernet/examples/DhcpChatServer on teensy ++ 2
 
More details

First, please make sure you have the latest Teensyduino version installed, 1.18-rc2. A very similar bug was fixed some time ago.

If that doesn't work, please post a link to this library, and if this isn't one of the examples from the library, please post the code that reproduces this problem.

I can only look into this if you give me enough info to recreate the problem here.

I discovered the problem with 1.17 and Arduino 1.0.5. I've now installed 1.18-rc2 (January 5th). Trying to compile FastLED's Blink example, I get the same error. Looking at /Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy/new.cpp, I see:
Code:
//int __cxa_guard_acquire(__guard *g) {return !*(char *)(g);};
//void __cxa_guard_release (__guard *g) {*(char *)g = 1;};
//void __cxa_guard_abort (__guard *) {}; 

//void __cxa_pure_virtual(void) {};

If I remove the comments to reactivate the code, the compilation succeeds, and the code works as expected.

The exact version of FastLED I'm using: https://s3.amazonaws.com/github-clo...338070&Signature=bvWpjlUEaXMQjAaSsCzuZX15NZc=, from https://github.com/FastLED/FastLED/releases
 
Status
Not open for further replies.
Back
Top