Perhaps this is a known issue, but I cannot find much reference to it.
is part of the standard library of C++.
Whenever I include in any c++ program (even one with an empty setup() and loop()):
#include <random>
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
I get an error:
In file included from C:\Users\jmdod\AppData\Local\arduino\sketches\616BE7B5631EB5ABB17A18FC8E74A54A\sketch\sketch_feb6a.ino.cpp:1:0:
c:\users\jmdod\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\random.tcc: In member function 'std::poisson_distribution<_IntType>::result_type std::poisson_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&, const std::poisson_distribution<_IntType>::param_type&)':
C:\Users\jmdod\AppData\Local\Arduino15\packages\arduino\hardware\mbed_giga\4.2.1\cores\arduino/Arduino.h:63:16: error: expected unqualified-id before '(' token
** #define abs(x) ((x)>0?(x):-(x))**
** ^**
C:\Users\jmdod\AppData\Local\Arduino15\packages\arduino\hardware\mbed_giga\4.2.1\cores\arduino/Arduino.h:63:16: error: expected unqualified-id before '(' token
** #define abs(x) ((x)>0?(x):-(x))**
** ^**
c:\users\jmdod\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\random.tcc: In member function 'std::binomial_distribution<_IntType>::result_type std::binomial_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&, const std::binomial_distribution<_IntType>::param_type&)':
C:\Users\jmdod\AppData\Local\Arduino15\packages\arduino\hardware\mbed_giga\4.2.1\cores\arduino/Arduino.h:63:16: error: expected unqualified-id before '(' token
** #define abs(x) ((x)>0?(x):-(x))**
** ^**
C:\Users\jmdod\AppData\Local\Arduino15\packages\arduino\hardware\mbed_giga\4.2.1\cores\arduino/Arduino.h:63:16: error: expected unqualified-id before '(' token
** #define abs(x) ((x)>0?(x):-(x))**
** ^**
exit status 1
Compilation error: exit status 1
I tried both MBED OS parts I use (RP2040 Connect and Giga R1) with the same result.