Dev Compiles but CLI doesn't

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!

#define makeString(s) str(s)
#define str(s) #s

#include "Particle.h"


/************************** SOFT AP CODE STARTS HERE **************************/

The macros work… I verified before I reorganized my file structure.

What command are you using for CLI build?
Although superfluous knowing your experience, I still ask what CLI version? :blush:

Version: 1.21.0

this instruction to compile using the command line: particle compile photon

Can you post the errors and a overview of your file hierarchy?

Also make sure your tree does not contain any files that reeimplement setup() and/or loop().
Copying external libraries also copies the supplied samples which will break your build - but that would hit Dev and CLI just the same :confused:

You may also try particle compile photon . --target 0.6.0 (the dot . is intentionally to refer to the current directory - provided you are running CLI from the location where the file lives)

I’m not using the Particle hierarchy, so that may be part of my problem wth the linking errors, which I understand.

I cannot post my errors un-redacted so give me some time to get back to you.