I am moving from the WebIDE to get to learn Workbench. I initialised a new project. Installed all the libraries, copied all the src files from a downloaded zip from the WebIDE.
1st compile error
/Users/shanevanj/Documents/Workbench/fMonX/fMonX1/lib/ArduinoJson/src/ArduinoJson/Strings/SizedFlashStringAdapter.hpp: In member function 'int8_t ArduinoJson6113_11000::SizedFlashStringAdapter::compare(const char*) const':
/Users/shanevanj/Documents/Workbench/fMonX/fMonX1/lib/ArduinoJson/src/ArduinoJson/Strings/SizedFlashStringAdapter.hpp:18:72: error: 'strncmp_P' was not declared in this scope
return -strncmp_P(other, reinterpret_cast<const char*>(_str), _size);
obviously objecting to strncmp_P, understandable as there is only one space in Gen3 devices (my target) - however in the web wide the doesnāt happen - So how do I get around it without necessarily editing library files locally ?
if you are comfortable sharing your source or simplified version of it that reproduces the error, iād be happy to take a look.
in the meantime, things to double-check are: platform (photon, argon, etc) and Device OS version - make sure you have them set the same way across both WebIDE and Workbench. you can change these settings via VSCodeās āstatusā bar at the bottom of the window (typically itās blue / cyan) - just click the entries and youāll be prompted to select values. you can also run the Particle: Configure Workspace for Device command and itāll walk you through making the changes.
also, if you havenāt seen them already, Workbench docs are over here:
Create new project, install ArduinoJSON libray. Open lib/ArduinoJson/examplesJsonParserExample. Copy contents to your new project .ino file and compile. error produced is
/Users/shanevanj/Documents/Workbench/ArduinoJson/Test/lib/ArduinoJson/src/ArduinoJson/Strings/SizedFlashStringAdapter.hpp: In member function 'int8_t ArduinoJson6113_11000::SizedFlashStringAdapter::compare(const char*) const':
/Users/shanevanj/Documents/Workbench/ArduinoJson/Test/lib/ArduinoJson/src/ArduinoJson/Strings/SizedFlashStringAdapter.hpp:18:72: error: 'strncmp_P' was not declared in this scope
return -strncmp_P(other, reinterpret_cast<const char*>(_str), _size);
This is Photon target with deviceOS@1.0.1. selected, then try with deviceOS@1.2.1. - same error.
I then edited spark_wiring_arduino.h in ā¦toolchains/deviceOS/1.2.1/firmware-1.2.1/wiring/inc/ and added in
Essentially I came to the same conclusion as @ScruffR did in that thread.The definition above is missing from the Arduino compatibility macros in each deviceOS release fro workbench. Once you add it in it all works. It needs to be be logged as an issue for the workbench team to add in this macro.
As it seems pgmspace.h is not included when not also including Arduino.h but for existing libraries that were ported for Particle beforeArduino.h was added to the build farms thatās suboptimal
But if you #include <Arduino.h>before any dependent headers you should be good.