Compiler timed out or encountered an error


#61

Hey all,
I’m having the same error, but an interesting twist is that the project file works perfectly on the Mac version of Particle Dev, but not the Windows 10 version… Any ideas?


#62

It appears to be a bug. It only occurs if:

  • Your main source file has a .ino file extension
  • You have a project.properties file
  • You are targeting system firmware 0.6.0 or later

If any of those conditions is not true, then you’ll get the correct error messages as you’d expect.

For example, you can rename your source file to have a .cpp file extension instead of .ino and add to the top:

#include "Particle.h"

Or if you are not using any libraries, you can remove the project.properties file.

I’m not sure how long it will take for a bug fix, but either of those workarounds, or using the CLI, can be used to work around the problem for now.

You can track the status of this issue here.


#63

This error can also occur if you’ve … say … copy and pasted your .h file into your .cpp file, and forgotten to implement one of the functions :confused:

ie, the implementation in library2.cpp only contains:

LIB_Ret_t LIB_LibraryFunction(uint8_t data);

and is missing its code block { … } with the implementation.

If that function is called somewhere in a chain (ie main.cpp -> library.cpp -> library2.cpp) where library2.cpp has the unimplemented function, it causes “Compiler timed out or encountered an error”.

Commenting out the calling function in main.cpp will allow compilation to succeed, and un-commenting it will cause it to fail with this message. Adding the implementation in library2.cpp resolves the issue.


#64

I am getting the “Compiler timed out or encountered an error” message in the Particle Desktop IDE. However, if I do:

particle compile electron in the directory it works.

The IDE is signed into my Particle account. Is there a place I can find a more descriptive error message. The current message is almost completely useless.


#65

There are 63 posts in this thread, several of them point at your main culprits, but no the IDE doesn’t give you any way of getting further detail, there are benefits to using the console… Are you using the latest version of ParticleDev?


#66

The Atom interface is at 1.19.0 which says it is the latest when I check for updates.
It also says that all my packages are up to date.


#67

When you use the CLI what is the error that you’re seeing?


#68

There is no error when using the CLI. It compiles and flash normally. Only the IDE has the error.


#69

Oh that’s interesting. Is it possible for you to share your app with us?


#70

My post above from June 2 includes a link to a library that causes the problem.


#71

I just got this same error, it turns out that the trouble was with the variable name length.
I’m not sure why, but when I changed the variable name, it compiled fine.

This caused the compiler error (I even tried camel case): Particle.variable("heartbeatvalue", heartbeatvalue);

This resolved the error which made me think it was something to do with the variable length: Particle.variable("bpmvalue", bpmvalue);


#72

Particle.variable names are limited to 12 characters, as is stated in the documentation (here)


#73

Also having issues but I could identify 1 line of code, that made it break when compiling for 0.6.4 from the CLI or the Desktop IDE:

PRODUCT_VERSION(1);

Maybe that helps…


#74

I had a similar problem.
The problem was caused from using a Particle.variable() name which was too long. It must NOT be longer than 12 characters.
It would be great to have a real error message instead of a timeout :slight_smile:

I hope it will help.


#75

I got just that when trying it on 0.6.3.


#76

How did you get this error?

When I’m compiling in the local IDE, I have absolutely no error. Is there a way to display these errors?


#77

I had this error “compiler timed out or encountered an error” because I exceeded max length of particle variable name:

ie.:
Particle.variable("THIS_IS_VERY_LONG_VARIABLE_NAME", _DBG_indexToInsertPoint);

after changing this name to few characters (I don’t remember exact limit, however it can be found in documentation) everything works fine and error disappeared.