So, I must be doing something wrong here.
I am attempting to port an existing Arduino library to the Particle ecosystem, but the included examples makes the build not succeed.
For a minimal test case, I am doing:
mkdir mytestlib cd mytestlib particle library create ? Enter a name for your library: mytestlib ? Enter a version for your library: 0.0.1 ? Who is the author of your library: me create library.properties create README.md create LICENSE create src/mytestlib.cpp create src/mytestlib.h create examples/usage/usage.ino
Then when I try to build the minimal example with:
particle compile photon
I get the error:
/workspace/examples/usage/usage.cpp:3:23: fatal error: mytestlib.h: No such file or directory // Example usage for mytestlib library by me.
The automatically generated skeleton example does the include line with quotes:
But I was under the impression that the correct form should be:
Unfortunately, that also fails with the same error.
However, this does succeed:
particle compile photon examples/usage
I am not sure if this is the expected behavior or not. This seems to imply that I would have to move the example out of the library file structure to verify that the library builds correctly, then move them back to upload & publish. Help?