I’ve been trying to compile my .ino using particle compile electron --target 0.6.4. But it is giving me the error that “SparkJson.h” library not found as shown is SS below:
I have included the library in project.properties. I have the latest CLI version. Please help me solving this issue.
How did you?
What's the contents of your project.properties?
From where did you run the compile command? (you need to be in the folder where project.properties lives, not where the .ino is)
PS C:\Particle\Test> particle project create
What would you like to call your project? [myproject]: TestJSON
Would you like to create your project in the default project directory? [Y/n]: n
Would you like to create your project in C:\Particle\Test? Type “n” to cancel. [Y/n]:
Initializing project in directory C:\Particle\Test\TestJSON...
> A new project has been initialized in directory C:\Particle\Test\TestJSON
PS C:\Particle\Test> cd .\TestJSON\
PS C:\Particle\Test\TestJSON> particle library add sparkjson
> Library SparkJson 0.0.2 has been added to the project.
> To get started using this library, run particle library view SparkJson to view the library documentation and sources
PS C:\Particle\Test\TestJSON> cd .\src\
PS C:\Particle\Test\TestJSON\src> notepad .\TestJSON.ino
... then I pasted one of the library samples to that file and ...
PS C:\Particle\Test\TestJSON> particle compile electron . --target 0.6.4
Compiling code for electron
Targeting version: 0.6.4
Including:
src\TestJSON.ino
project.properties
attempting to compile firmware
downloading binary from: /v1/binaries/5a44e4049cf4665f9b1d04c7
saving to: electron_firmware_1514464248355.bin
Memory use:
text data bss dec hex filename
17500 168 1676 19344 4b90 /workspace/target/workspace.elf
Compile succeeded.
Saved firmware to: C:\Particle\Test\TestJSON\electron_firmware_1514464248355.bin
@ScruffR, what I was doing wrong is I was compiling the project folder. I've changed the path and it worked for the MDNS code!
Also, my main project which has "SparkJson.h" and few other libraries. Few of those libraries were private to my team's particle account and I was logged in my personal account. Now, it is compiled and binary is saved successfully.