I’ve been seeing the following compiler error in the Particle Dev IDE, but from anywhere between 25-75% of the time:
(for searchability, it says “expected constructor, destructor, or type conversion before ‘(’ token”)
The line it is referencing just says
I’m not sure why there is nondeterminism, but could it be that some servers in the build farm are building against an older version of the system firmware?
I’ve tried this from the CLI with a minimal example and have received the same results. Here’s two successive compilation attempts with no change in code between:
$ particle compile photon Compiling code for photon Including: /Users/vishal/Workspace/sandbox/main.ino attempting to compile firmware pushing file: /Users/vishal/Workspace/sandbox/main.ino Memory use: text data bss dec hex filename 2892 8 352 3252 cb4 /spark/compile_service/shared/workspace/6_platform_6_20_8/firmware/7fd1ace8c670e631101f17b5ef25785b4ecc881f1fef3db752d557dacb8c/7fd1ace8c670e631101f17b5ef25785b4ecc881f1fef3db752d557dacb8c.elf grabbing binary from: https://api.particle.io/v1/binaries/56705e87b843e8b270299b7b Compile succeeded. Saved firmware to: /Users/vishal/Workspace/sandbox/photon_firmware_1450204804194.bin $ particle compile photon Compiling code for photon Including: /Users/vishal/Workspace/sandbox/main.ino attempting to compile firmware pushing file: /Users/vishal/Workspace/sandbox/main.ino Errors main.cpp:2:14: error: expected constructor, destructor, or type conversion before '(' token #include "application.h" ^ make: *** [../build/target/user/platform-6main.o] Error 1 make: *** [user] Error 2 Compile failed. Exiting.
Here’s a minimal example to replicate the issue. Without
SYSTEM_THREAD(ENABLED), this seems to compile fine 100% of the time.