Hi,
I have adapted a solution (for the Arduino Due) that makes use of the standard’s library header. Ever since I tried to include that I get some weird errors from stl_algobase.h, such as
:\users\..\.platformio\packages\toolchain-gccarmnoneeabi\arm-none-eabi\include\c++\8.2.1\bits\stl_algobase.h:195:5: error: expected unqualified-id before 'const'
min(const _Tp& __a, const _Tp& __b)
^~~
c:\users\...platformio\packages\toolchain-gccarmnoneeabi\arm-none-eabi\include\c++\8.2.1\bits\stl_algobase.h:195:5: error: expected ')' before 'const'
C:\Users\..\.platformio\packages\framework-arduino-sam\system\libsam/include/USB_device.h:364:31: note: to match this '('
#define Min(a, b) (((a) < (b)) ? (a) : (b))
^
c:\users\...\.platformio\packages\toolchain-gccarmnoneeabi\arm-none-eabi\include\c++\8.2.1\bits\stl_algobase.h:195:5: error: expected ')' before 'const'
min(const _Tp& __a, const _Tp& __b)
^~~
C:\Users\..\.platformio\packages\framework-arduino-sam\system\libsam/include/USB_device.h:364:30: note: to match this '('
#define Min(a, b) (((a) < (b)) ? (a) : (b))
As you can see I get these error not only on the originally installed 7.2.1 but also on the 8.2.1 toolchain, so it should not be related to the toolchain.
I have seen a related post with exactly the same errors, but these seem to be depending on the type of Linux distribution they were using. See for instance
https://forums.debian.net/viewtopic.php?t=136970
They seem to point out that the problem is related to the toolchain after all, but the release numbers cannot be compared due to the completely different platform used.
Could an incorreclty selected c++ standard be to blame? I believe that C++11 is currently set as default?