etl: Unknown new-header on Arduino megaAVR Boards

Issue When compiling the ETL for the Arduino Nano-Every, it fails due to a missing include in <memory.h>. For some reason, avr-gcc does not handle <new>, only <new.h>.

Suggested Solution change #include <new> to #include <new.h> and #include <memory> to #include <memory.h>. I am not sure if this will affect other platforms?

I will make a PR - Tests are running fine on avr-gcc with Arduino Nano-Ever - lets see if other platforms work?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (19 by maintainers)

Most upvoted comments

I’ve decided to call the ETL’s version placement_new.h.

Ok, I found the board right setup to make it fail. I didn’t have the right board support installed.

I’m looking at automatic detection (if not explicitly defined) for the <new> header, in platform.h

// Figure out if we have a standard library <new> header available.
#if !defined(ETL_USING_STD_NEW)
  #if defined(__has_include)
    #define ETL_USING_STD_NEW __has_include(<new>)
  #elif ETL_USING_STL && !defined(ARDUINO) && !defined(__AVR__)
    #define ETL_USING_STD_NEW 1
  #else
    #define ETL_USING_STD_NEW 0
  #endif
#endif