Particle Dev: Build didn't produce binary Error


#3

SOLVED

I found this post:

My code had: "Spark.variable(“result”, &resultstr, STRING);"
I changed it to “Spark.variable(“result”, resultstr, STRING);” and compile started to work!


#4

@photonizer, glad you found your error in the code.

It would be nice if Particle Dev generated a less cryptic response!

I don’t know if Particle Dev is current with the latest firmware release. @suda ?


#5

There is a bug open on the lack of detail in compiler errors when using Particle-Dev. I think @mdma is working it. Bug #79 and #110 are both related.


#6

@photonizer, @sazp96

Just to be prepared if some other “cryptic” messages pop up in future, due to the transition from :spark: Spark.IO to :particle: Particle.IO a while back the keyword Spark will be deprecated and changed over to Particle.
So try to already replace things like Spark.function() with Particle.function() - currently it should work both ways on the Core but I don’t think the old version still works on the Photon.


#7

@photonizer, thanks for pointing me out to the variables. As soon as I commented out my string Particle.variable() my code compiled again.

@ScruffR, I have updated all my Spark. to Particle.. It was about time to do it.

Has Particle.variable stop supporting the String class? The code below generates the “Build didn’t produce…” error:

String varMyIP = "000.000.000.000";
...
Particle.variable("PublicIP", varMyIP, STRING);

#8

look here:

you’ll want to use a C string


#9

Just as a side note about String and Particle.variable()

Even if it works at some point it might stop working under some circumstances and errors like that are a hell of a job to find.


#10

Thank you @BulldogLowell and @ScruffR. I will do the switch to C string.


#11

Hi,
I’m trying to run from Particle Dev, a software on the Photon, but I’m getting the “Build didn’t produce binary error”. How Can I fix it? The software is .ino extension.


#12

There are a few things that can cause this error.

One that we keep bumping into is the size of our binary. How many kb was the last binary you were able to compile? If your new binary is greater than 128kb you would get this error.


#13

Another cause of “Build didn’t produce binary” with no error listed is that the directory containing the .ino file contains more than one .ino file. It doesn’t just build the file you have open, it builds all of the .cpp and .ino files in that directory so you can use libraries.


#14

And a number of other reasons discussed in the forum.

Usual response:
Provide more background, code, screenshot, … to save us from needing to guess around :crystal_ball:

Just a few
Particle Dev won't build, particle-cli will
Particle Dev: "build didn't produce binary"
Particle Dev with multiple projects - what?
Particle dev will not compile
Particle Dev objbase.h no such file Cannot compile

Mostly the same reasons :wink:


#15

Thank you for your reply. In my project there a some different library, so I have multiple cpp and h file, with just one .ino file. I always get that problem…


#16

I had this same problem today and after I chose a device, the error went away. For those with no compile problems perhaps this would help with your issue.


#17

I had this problem and the actual issue was a particle.function with too long of a name (12 character max). Hope this helps someone.


#18

What version were you targeting?
AFAIK with more recent versions you should get an explicit warning/error when providing too long names.
If this wasn’t the case with the most recent version, we might have found a regression.

But I do get

In file included from ../wiring/inc/spark_wiring.h:48:0,
                 from ./inc/application.h:36,
                 from _inttest.cpp:2:
../wiring/inc/spark_wiring_cloud.h: In instantiation of 'static bool CloudClass::function(const T&, Types ...) [with T = char [14]; Types = {int (*)(String)}]':
_inttest.cpp:25:41:   required from here
../wiring/inc/spark_wiring_cloud.h:188:9: error: static assertion failed: 

In Particle.function, name must be less than 12 characters

Although it should actually be In Particle.function, name length must be equal or less than 12 characters


#19

I was targeting 0.5.3


#20

I’m also getting this error, using an brand new Electron 2G. When I click on the message, Particle-dev tells me “There were no compile errors.” My project has a .cpp and .h file in the project directory alongside my .ino file, which has a #include “mylib.h” at the top of it.

Using Particle-dev to comipe and generate a binary seems to work fine on a trivial stand alone .ino file in its own directory (i.e. with an empty setup and loop).

Are multi-file projects just not yet supported in Particle-dev? This documentation would lead me to believe it was…


#21

Yes, they are supported.
Can you post a screenshot of the full Dev window?


#22

@ScruffR yea sure, mildly santized…

It must be something about the actual contents of my project but when I click on the red text in the bottom bar of the screen shot above, this pops up, which makes it seem like there’s no problem.

I can, nevertheless download the binary from the Cloud IDE without issue.