You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have read the documentation at readthedocs and the issue is not addressed there.
I have tested that the issue is present in current master branch (aka latest git).
I have searched the issue tracker for a similar issue.
If there is a stack dump, I have decoded it.
I have filled out all fields below.
Platform
Hardware: ESP-12
Core Version: 3.0.2
Development Env: Arduino IDE 1.8.15
Operating System: Ubuntu (Linux Mint)
Settings in IDE
Module: "Nodemcu 1.0 (ESP-12 Module)"
Flash Mode: ?? [qio|dio|other]
Flash Size: 4MB
lwip Variant: v2 Lower Memory
Reset Method: ?? [ck|nodemcu]
Flash Frequency: ?? [40Mhz]
CPU Frequency: 80Mhz
Upload Using: SERIAL
Upload Speed: 115200 (serial upload only)
Problem Description
When StreamString.h is included from the *.cpp file and <algorithm> is not included before, following error message is given by the compiler:
error: 'min' is not a member of 'std'
In file included from /home/testuser/git/StreamStringBugExample/Test1.cpp:4:
/home/testuser/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/StreamString.h: In member function 'virtual int S2Stream::read(uint8_t*, size_t)':
/home/testuser/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/StreamString.h:89:29: error: 'min' is not a member of 'std'
89 | size_t l = std::min(len, (size_t)string->length());
| ^~~
The problem does not appear if StreamString.h is included from the *.ino file.
// #include <WString.h> // not needed as it is included from StreamString.h
#include<Stream.h>// this include is also needed for the StreamString.h// #include <algorithm> // with this not commented out, the code would compile
#include<StreamString.h>voiddo_test()
{
StreamString s;
s.println("This is a test");
}
Possible solution
At the beginning of StreamString.h, one should include the headers that are used by this file:
#include"Stream.h"
#include<algorithm>
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Basic Infos
Platform
Settings in IDE
Problem Description
When StreamString.h is included from the *.cpp file and <algorithm> is not included before, following error message is given by the compiler:
The problem does not appear if StreamString.h is included from the *.ino file.
MCVE Sketch (two files)
StreamStringBugExample.ino
Test1.cpp
Possible solution
At the beginning of StreamString.h, one should include the headers that are used by this file:
The text was updated successfully, but these errors were encountered: