ekstrand / ESP8266wifi

ESP8266 Arduino library with built in reconnect functionality
MIT License
450 stars 235 forks source link

Error compiling - missing "min" #35

Open gioreva opened 7 years ago

gioreva commented 7 years ago

1) Not Compile. See abore errors. 2) Can I have one example of costructor, hardware serial and no reset connectet ?

Arduino:1.7.11 (Windows 7), Scheda:"Arduino M0"

D:\Documents\Arduino\libraries\ESP8266wifi-master\ESP8266wifi.cpp: In member function 'WifiMessage ESP8266wifi::listenForIncomingMessage(int)':

D:\Documents\Arduino\libraries\ESP8266wifi-master\ESP8266wifi.cpp:547:60: error: 'min' was not declared in this scope

     readBuffer(&msgIn[0], min(length, sizeof(msgIn) - 1));

                                                        ^

D:\Documents\Arduino\libraries\ESP8266wifi-master\ESP8266wifi.cpp: In member function 'WifiMessage ESP8266wifi::getIncomingMessage()':

D:\Documents\Arduino\libraries\ESP8266wifi-master\ESP8266wifi.cpp:584:60: error: 'min' was not declared in this scope

     readBuffer(&msgIn[0], min(length, sizeof(msgIn) - 1));

                                                        ^

Errore durante la compilazione

Questo report potrebbe essere più ricco di informazioni con "Mostra un output dettagliato durante la compilazione" abilitato in "File > Impostazioni"

cederberg commented 7 years ago

What kind of environment are you compiling in? The min function is part of the Arduino "language reference", so it should be available in all compatible environments. See https://www.arduino.cc/en/Reference/Min