I’m getting a weird error when trying to compile a sketch in the Particle Build, that uses the MQTT and SparkJson libraries. I say weird, because yesterday I had four working sketches, and today any of them will compile
The errors mention a library I’m never seen before, in a folder with the name of the microcontroller (STM32). Have a look at this…
Any idea of what am I doing wrong?
I checked the code tons of times, and I cannot find the error. Since the same code worked perfectly yesterday, I suspect that it might be an “external” issue… Or am I too dumb to realize of my error???
Found the issue after the MQTT library now tries to compile. There is use of the word retained here:
bool MQTT::publish(char* topic, uint8_t* payload, unsigned int plength, bool retained)
which is a reserved keyword now. I just changed this to kept and it compiled. Obviously this is a bit of work to get the owner to update, but we can pretty easily submit a PR to their repo, which I have done here: https://github.com/hirotakaster/MQTT/pull/9 (If you have a github account and wanna go vote that up with a to increase exposure, please do )
I’m still having problems, same error, no changes… any idea?
Do the libraries need to be re-imported to Particle Build, or it reads them directly from GitHub?
As a workaround, if you don’t need the features in 0.4.6, you can revert to 0.4.5 in the IDE (click, “devices” then select your device and click the arrow, which will allow you to select a version.)
We will look at how to make this available as an opt-in so that the keyword doesn’t clash with existing code.