# An "impossible" compiler error message

**URL:** <https://community.particle.io/t/an-impossible-compiler-error-message/18318>\
**Category:** Troubleshooting\
**Created:** [December 16, 2015, 2:40am UTC](https://community.particle.io/t/an-impossible-compiler-error-message/18318 "2015-12-16T02:40:14Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![randyenger](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@randyenger](https://community.particle.io/u/randyenger)\
**Post date:** [December 16, 2015, 2:40am UTC](https://community.particle.io/t/an-impossible-compiler-error-message/18318/1 "2015-12-16T02:40:14Z")

</div>

I using the cloud compiler and a (brand new) Photon. I occasionally/frequently get the following error message:

```
error: 'class USBSerial' has no member named 'printf'

```

and  
error: ‘class SystemClass’ has no member named ‘ticksPerMicrosecond’

but then I’ll re-compile my code (_without having changed anything_) and it’ll compile just fine (and flash and run fine).

One thing I’ve noticed (and I hesitate to even mention it because it sounds crazy and should be completely irrelevant based on my model of how software works) is that this happens more frequently when the program running in the Photon is doing output to the serial port at the time of the compilation/flashing. (Compiling and flashing are done over the air …) I had a serial.println() by mistake being invoked everything time through ‘loop()’, and it took a dozen tries or more to flash a fixed version. As I reduced the serial.print calls the above error messages happened less frequently.

Post hoc ergo and all that, I know, but … Any ideas about what’s going on here?

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [December 16, 2015, 2:54am UTC](https://community.particle.io/t/an-impossible-compiler-error-message/18318/2 "2015-12-16T02:54:08Z")

</div>

Hi @randyenger

I think you are running into this issue:

> **['Particle' was not declared in this scope](http://community.particle.io/t/particle-was-not-declared-in-this-scope/18285)**
>
> I am using the Web IDE to compile two previously working Particle Core applications and I get the "'Particle' was not declared in this scope" error with the line number pointing at a "Particle.publish" function. This is unchanged and previously...

Can you try switching the web IDE to compile against 0.4.7 instead of 0.4.7. latest?

---

<div class="post-metadata">

**Author:** ![lucasS](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/lucass/32/8065_2.png) [@lucasS](https://community.particle.io/u/lucasS)\
**Post date:** [December 16, 2015, 12:00pm UTC](https://community.particle.io/t/an-impossible-compiler-error-message/18318/3 "2015-12-16T12:00:34Z")

</div>

I am also experiencing this problem with compilation using particle dev.

When is likely to be fixed and is there a way we can change the compiler used in particle dev ?

---

<div class="post-metadata">

**Author:** ![randyenger](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@randyenger](https://community.particle.io/u/randyenger)\
**Post date:** [December 16, 2015, 9:34pm UTC](https://community.particle.io/t/an-impossible-compiler-error-message/18318/4 "2015-12-16T21:34:54Z")

</div>

Thanks, @bko. That seems to work. (I say “seems” only because the problem had been a little intermittent before, and without exhaustive testing, dot dot dot.)

I appreciate the quick reply!

-Randy

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [December 16, 2015, 10:02pm UTC](https://community.particle.io/t/an-impossible-compiler-error-message/18318/5 "2015-12-16T22:02:16Z")

</div>

This underlying build farm issue should be resolved, so `Latest` should be OK again (at least for the Photon).

---

<div class="post-metadata">

**Author:** ![randyenger](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@randyenger](https://community.particle.io/u/randyenger)\
**Post date:** [December 16, 2015, 11:51pm UTC](https://community.particle.io/t/an-impossible-compiler-error-message/18318/6 "2015-12-16T23:51:29Z")

</div>

Great! Thank you.

---

<div class="post-metadata">

**Author:** ![Moookeee](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Moookeee](https://community.particle.io/u/Moookeee)\
**Post date:** [December 17, 2015, 7:02am UTC](https://community.particle.io/t/an-impossible-compiler-error-message/18318/7 "2015-12-17T07:02:13Z")

</div>

I’m having the same problem. I’m using a particle core and using particle DEV on the mac. Made sure I have updated Cli to latest (1.8.20) but still getting errors like ‘particle’ was not declared in this scope and also now missing the EEPROM.update function!

When will this be fixed?

Edit: When I change the EEPROM.update function to EEPROM.write I can compile and download but the core goes flashing red SOS (+1 solitary flash) immediately. Now I’m not sure is the problem with the 0.4.7 update or is it my code? I guess I’ll wait a while and see if it changes in the next few days. Bit of a bummer because I spent 4hrs trying to solve this.

---

<div class="post-metadata">

**Author:** ![Mapoint](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@Mapoint](https://community.particle.io/u/Mapoint)\
**Post date:** [July 20, 2019, 4:00pm UTC](https://community.particle.io/t/an-impossible-compiler-error-message/18318/8 "2019-07-20T16:00:13Z")

</div>

![Errror-Argon](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/a/9/a9badd76fe3225b5b530301aa6eebdad9897fd82.png)

Hello, Scruff Any ideas why I am getting a delcaration error when I compile ino file using webIDE build tool? What is the default syntax the compiler is a programmer to recognize C, Object-C, C++, Aurdino info. Perhaps the all same color ice-cream with different flavors you have to try it to know the difference. Here is a reference discussion [https://arduino.stackexchange.com/questions/816/c-vs-the-arduino-language](https://arduino.stackexchange.com/questions/816/c-vs-the-arduino-language)

---

<div class="post-metadata">

**Author:** ![Moors7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moors7/32/588_2.png) [@Moors7](https://community.particle.io/u/Moors7)\
**Post date:** [July 20, 2019, 4:12pm UTC](https://community.particle.io/t/an-impossible-compiler-error-message/18318/9 "2019-07-20T16:12:50Z")

</div>

Could you show us your code?

---

<div class="post-metadata">

**Author:** ![Mapoint](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@Mapoint](https://community.particle.io/u/Mapoint)\
**Post date:** [July 20, 2019, 5:32pm UTC](https://community.particle.io/t/an-impossible-compiler-error-message/18318/10 "2019-07-20T17:32:14Z")

</div>

Hello Moors7  
Thanks for asking Actually I did not write the code the code was written [Nick Engmann](https://github.com/NickEngmann)

Systems Architecture Engineer at Circadence  
I straight way[downloaded the github zip file](https://github.com/NickEngmann/in-plants) and did a cut and past on WebIDE without any edits the file here is Inplants-argon.ino  
I hope this helps

---

<div class="post-metadata">

**Author:** ![Moors7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moors7/32/588_2.png) [@Moors7](https://community.particle.io/u/Moors7)\
**Post date:** [July 20, 2019, 6:20pm UTC](https://community.particle.io/t/an-impossible-compiler-error-message/18318/11 "2019-07-20T18:20:35Z")

</div>

That code is only 51 lines long, whereas your setup function seems to be on line 69, which is where it’d land if you copy&pasted it twice. Could you double check to make sure that’s not the case 😉 ?

---

<div class="post-metadata">

**Author:** ![Mapoint](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@Mapoint](https://community.particle.io/u/Mapoint)\
**Post date:** [July 20, 2019, 10:52pm UTC](https://community.particle.io/t/an-impossible-compiler-error-message/18318/12 "2019-07-20T22:52:41Z")

</div>

😅🤣😂 I am so used to cut and paste and it works every single time EXPECT for when I have not had my morning coffee Thanks !!! for pointing it out… It does compile now !!
