Compile error - MKRWifi1010

Hello,

With Arduino IDE 1.8.10, ArduinoMKR1010 example return an compile error in thinger :

….arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\stl_algobase.h:243:56: error: macro “min” passed 3 arguments, but takes just 2

 min(const _Tp& __a, const _Tp& __b, _Compare __comp)

Any idea ?

1 Like

Hello @grezco

Please can you provide us your code?

best

Hello,

This is the ArduinoMKR1010 example

 #include <ThingerWiFiNINA.h>

#define USERNAME "your_user_name"
#define DEVICE_ID "your_device_id"
#define DEVICE_CREDENTIAL "your_device_credential"

#define SSID "your_wifi_ssid"
#define SSID_PASSWORD "your_wifi_ssid_password"

ThingerWiFiNINA thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

void setup() {
  // configure wifi network
  thing.add_wifi(SSID, SSID_PASSWORD);

  pinMode(LED_BUILTIN, OUTPUT);

  // pin control example (i.e. turning on/off a light, a relay, etc)
  thing["led"] << digitalPin(LED_BUILTIN);

  // resource output example (i.e. reading a sensor value, a variable, etc)
  thing["millis"] >> outputValue(millis());

  // more details at http://docs.thinger.io/arduino/
}

void loop() {
  thing.handle();
}

Compiler error

In file included from c:\users\nicolas\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\char_traits.h:39:0,

                 from c:\users\nicolas\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\string:40,

                 from c:\users\nicolas\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\stdexcept:39,

                 from c:\users\nicolas\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\array:39,

                 from c:\users\nicolas\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\tuple:39,

                 from c:\users\nicolas\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\functional:54,

                 from C:\Users\Nicolas\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:33,

                 from C:\Users\Nicolas\Documents\Arduino\libraries\thinger.io\src/thinger/thinger.h:29,

                 from C:\Users\Nicolas\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:28,

                 from C:\Users\Nicolas\Documents\Arduino\libraries\thinger.io\src/ThingerWifi.h:27,

                 from C:\Users\Nicolas\Documents\Arduino\libraries\thinger.io\src/ThingerWiFiNINA.h:28,

                 from C:\Users\Nicolas\Documents\Arduino\libraries\thinger.io\examples\Arduino\ArduinoMKR1010\ArduinoMKR1010.ino:1:

c:\users\nicolas\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2

     min(const _Tp& __a, const _Tp& __b, _Compare __comp)

                                                        ^

c:\users\nicolas\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\stl_algobase.h:265:56: error: macro "max" passed 3 arguments, but takes just 2

     max(const _Tp& __a, const _Tp& __b, _Compare __comp)

insert

#undef max
#undef min

before
#include <thingerWifi101.h>

then it’s work.