Attempting to use PlatformIO with the latest version of this library and a Teensy2 (ATMega32U4) via
[env:teensy2]
platform = teensy
board = teensy2
framework = arduino
build_unflags = -fno-exceptions -std=gnu++11
build_flags = -DTEENSY_OPT_FASTEST -fexceptions -std=gnu++17
; use a more recent 7.3.0 compiler instead of 5.4.1
platform_packages =
toolchain-atmelavr@~3.70300.0
; fill in missing parts of the standard C++ library
lib_deps =
https://github.com/mike-matera/ArduinoSTL/archive/refs/heads/master.zip
In file included from .pio\libdeps\teensy2\ArduinoSTL\src/memory:20:0,
from .pio\libdeps\teensy2\ArduinoSTL\src/char_traits:22,
from .pio\libdeps\teensy2\ArduinoSTL\src/string:21,
from .pio\libdeps\teensy2\ArduinoSTL\src/stdexcept:22,
from src\main.cpp:2:
.pio\libdeps\teensy2\ArduinoSTL\src/new:41:18: error: declaration of 'void operator delete(void*) noexcept' has a different exception specifier
_UCXXEXPORT void operator delete(void* ptr) _UCXX_USE_NOEXCEPT;
^~~~~~~~
In file included from C:\Users\Max\.platformio\packages\framework-arduinoteensy\cores\teensy/Printable.h:26:0,
from C:\Users\Max\.platformio\packages\framework-arduinoteensy\cores\teensy/Print.h:28,
from C:\Users\Max\.platformio\packages\framework-arduinoteensy\cores\teensy/Stream.h:24,
from C:\Users\Max\.platformio\packages\framework-arduinoteensy\cores/usb_serial/usb_api.h:6,
from C:\Users\Max\.platformio\packages\framework-arduinoteensy\cores\teensy/usb_api.h:2,
from C:\Users\Max\.platformio\packages\framework-arduinoteensy\cores\teensy/WProgram.h:22,
from C:\Users\Max\.platformio\packages\framework-arduinoteensy\cores\teensy/Arduino.h:1,
from src\main.cpp:1:
Compiling .pio\build\teensy2\lib265\ArduinoSTL\eh_globals.cpp.o
C:\Users\Max\.platformio\packages\framework-arduinoteensy\cores\teensy/new.h:14:6: note: from previous declaration 'void operator delete(void*)'
void operator delete(void * ptr);
^~~~~~~~
So cores/teensy/new.h with its declaration of
void operator delete(void * ptr);
seems to be clashing with this library's declaration of
Attempting to use PlatformIO with the latest version of this library and a Teensy2 (ATMega32U4) via
and code
src\main.cpp
Results in
So
cores/teensy/new.h
with its declaration ofseems to be clashing with this library's declaration of
Maybe it's possible to detect the Teensyduino core case via
TEENSYDUINO
global macro and not declare / define thedelete
operator?