-
Notifications
You must be signed in to change notification settings - Fork 374
Both 3x and 4 fail to compile jsonlib.cpp in Arduino 1.8.1.3 and 2.0.0-beta.5 #125
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
That looks like a really fundamental corruption in your ESP arduino core install. The
There is nothing to 'fix' in my code for this, you need fix whatever is wrong in your toolchain. |
I too am seeing this issue when using the alpha preview version of the ESP arduino core. Dropping back to the 1.06 release compiles correctly. I find that the simple strings test example compiles correctly with the alpha (maybe because it does not call std::string::npos ?) At any rate the issue with std::string::npos seems to lie with the alpha version of the core. For now, to keep working with the alpha I work around the issue by editing src/jsonlib.cpp line 76 to avoid the issue:
|
https://www.cplusplus.com/reference/string/string/npos/ So the conditional Looks like this needs to be taken up as a issue with the ESP alpha. |
I just submitted espressif/arduino-esp32#5342 However, I'm pretty sure this is now the intended behaviour for the ESP core, it makes it consistent with other cores, eg neither the esp8266 or the official Arduino cores support std::string in this way either. String support in Arduino-land is, by convention, a subset of the full std::string package. So I've done a proper fix in the code to remove the std::string reference and ensure this is not a problem going forward. |
Both versions (3.x and 4) fail with this error message in both Arduino 1.8.1.3 and 2.0.0-beta.5:
sketch\src\jsonlib\jsonlib.cpp: In function 'String jsonExtract(String, String)':
sketch\src\jsonlib\jsonlib.cpp:75:34 error: 'std:string' has not been declared
if (json.indexOf(name) == std::string:npos) return json.substring(0,0);
The text was updated successfully, but these errors were encountered: