I’m refactoring some code from a flat directory to a tiered structure…
I came across what is likely some kind of bug in that my project will compile a binary in Dev, but I get linking errors in the CLI mainly related to the location of library files (which I expect). This was frustrating because I could flash my device but…
The compiled binary isn’t produced with a recognizable header that will allow its upload into the Products firmware bucket. This may have something to do with the linking error, but I wanted to introduce the idea that somehow, I am getting a compiled unit that won’t compile if I use the CLI build tool and the header information for a Product isn’t valid.
I thought they were the same compiler!
#pragma SPARK_NO_PREPROCESSOR
#define makeString(s) str(s)
#define str(s) #s
#define PARTICLE_PRODUCT_ID 1234
#define PARTICLE_PRODUCT_VERSION 1
#define CUSTOMER_URL somecustomerurl.com
#include "Particle.h"
PRODUCT_ID(PARTICLE_PRODUCT_ID);
PRODUCT_VERSION(PARTICLE_PRODUCT_VERSION);
/******************************************************************************/
/************************** SOFT AP CODE STARTS HERE **************************/
/******************************************************************************/
The macros work… I verified before I reorganized my file structure.