Not Compiling - Error in Particle library?

Hi Particle Community,

I have been trying to compile a file this evening. However, I have been receiving the following error:

expected ';' before '_fetch_usbserial'
../wiring/inc/spark_wiring_usbserial.h 104:16

I believe this is an error within the ‘Application.h’ library, but I am not sure as I have never encountered this before.

Any ideas or suggestions would be appreciated,

Thank you,


It’s probably a syntax error in your ino file.

Try to find the missing semicolon!


Dear Sammy, was this ever solved? I am having the exact same problem at the exact same location of the file.

Part of the raw error is as follows:

In file included from ./inc/application.h:49:0,
                 from src/hydroboy_with_cal.cpp:1:
hydroboy_with_cal.ino: In function 'void loop()':
../wiring/inc/spark_wiring_usbserial.h:104:16: error: expected ')' before '_fetch_usbserial'
 #define Serial _fetch_usbserial()

That line 104 char 16 is the same in both our cases. Interesting. Did you ever get it fixed?

The error is certainly not in the particle framework otherwise we’d see such reports way more often.
I’d rather suspect this to be rooted in hydroboy_with_cal and loop().
If you can show your code we might be able to spot the problem.

BTW, what system version are you targeting and what version have you got on your device?

1 Like

Thanks for the quick reply @ScruffR . Thanks for pointing out that the problem should be in the void loop(). Noob mind of mine kept thinking there was something wrong with the


because that’s what it said on the error. Even the link from the error message would point me towards line 104 of my code. Turns out it was a false flag.

I was just missing a parenthesis and a semicolon within void loop().

Lesson of the day: Error messages aren’t always too truthful. However, in some ways, it IS truthful because the error message DID say the error was inside void loop().


and it mentioned…

./wiring/inc/spark_wiring_usbserial.h:104:16: error: expected ')' before '_fetch_usbserial'

that it was a missing parenthesis!

that’s like, mostly truthful.