-
Notifications
You must be signed in to change notification settings - Fork 13.3k
'min' was not declared in this scope #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The most recent commit, 'fix tools path', seems to have fixed this, so closing.... |
It appears I didn't test enough; the issue still occurs :( |
I just download 1.6.5 via http://arduino.esp8266.com/staging/package_esp8266com_index.json . I have same issue and same error message with blurfl. This error is not occurred when I use 1.64 version. How can I fix it? Thanks in advance. |
Id fixed this while adding #define min(a,b) ((a)<(b)?(a):(b)) to my sketch. |
Min/max seems broken again in latest git version as of today. |
https://github.com/esp8266/Arduino/blob/master/cores/esp8266/Arduino.h#L251-L258 |
Same issue of "'min' was not found in this scope". Just install the ver 2.2.0 |
Same here with 1.6.9. |
Had the same issue, min() worked before adding the following libraries:
I replaced |
Solution as per esp8266/Arduino#263 (comment). Should fix oxan#12
A trivial sketch raises a compile error "'min' was not declared in this scope".
I don't know enough to dig further, but one clue might be that commenting out the line:
include "FileSystem.h"
in Arduino.h allows the trivial sketch to compile.
Arduino: 1.6.5 (Mac OS X), Board: "Generic ESP8266 Module, 80 MHz, 115200, 512K (64K SPIFFS)"
junk.ino: In function 'void setup()':
junk:3: error: 'min' was not declared in this scope
junk.ino:3:16: note: suggested alternative:
In file included from /Users/username/Desktop/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/memory:62:0,
from /Users/username/Desktop/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/cores/esp8266/FileSystem.h:24,
from /Users/username/Desktop/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/cores/esp8266/Arduino.h:214,
from junk.ino:1:
/Users/username/Desktop/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/stl_algobase.h:239:5: note: 'std::min'
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
junk:4: error: 'max' was not declared in this scope
junk.ino:4:16: note: suggested alternative:
In file included from /Users/username/Desktop/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/memory:62:0,
from /Users/username/Desktop/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/cores/esp8266/FileSystem.h:24,
from /Users/username/Desktop/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/cores/esp8266/Arduino.h:214,
from junk.ino:1:
/Users/username/Desktop/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/stl_algobase.h:260:5: note: 'std::max'
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
'min' was not declared in this scope
[code]
// junk.ino
void setup() {
int x = min(3,4);
int y = max(3,4);
}
void loop() {
}
[/code]
The text was updated successfully, but these errors were encountered: