IDE Throws Errors on Arduino Functions, Variables and Structure Elements

I cleaned out files to gain additional memory on Mac Catalina OS 10.15.7 .
Now, when verifying, IDE 2.3.2 throws errors on Arduino Functions, Variables and Structure Elements.
I reinstalled the IDE with same result. I installed IDE 1.8.19 with same result.
I would appreciate help in solving this problem. Tks.

Example Using Builtin Sketch ‘Blink’

/*
  [https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink]
*/

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
}

Compile Errors

/private/var/folders/7l/3s5_91xs3zv24225c7jfq2mw0000gn/T/.arduinoIDE-unsaved202443-3014-effyou.q418h/Blink/Blink.ino: In function 'void setup()':
/private/var/folders/7l/3s5_91xs3zv24225c7jfq2mw0000gn/T/.arduinoIDE-unsaved202443-3014-effyou.q418h/Blink/Blink.ino:28:11: error: 'LED_BUILTIN' was not declared in this scope
   pinMode(LED_BUILTIN, OUTPUT);
           ^~~~~~~~~~~
/private/var/folders/7l/3s5_91xs3zv24225c7jfq2mw0000gn/T/.arduinoIDE-unsaved202443-3014-effyou.q418h/Blink/Blink.ino:28:24: error: 'OUTPUT' was not declared in this scope
   pinMode(LED_BUILTIN, OUTPUT);
                        ^~~~~~
/private/var/folders/7l/3s5_91xs3zv24225c7jfq2mw0000gn/T/.arduinoIDE-unsaved202443-3014-effyou.q418h/Blink/Blink.ino:28:3: error: 'pinMode' was not declared in this scope
   pinMode(LED_BUILTIN, OUTPUT);
   ^~~~~~~
/private/var/folders/7l/3s5_91xs3zv24225c7jfq2mw0000gn/T/.arduinoIDE-unsaved202443-3014-effyou.q418h/Blink/Blink.ino: In function 'void loop()':
/private/var/folders/7l/3s5_91xs3zv24225c7jfq2mw0000gn/T/.arduinoIDE-unsaved202443-3014-effyou.q418h/Blink/Blink.ino:33:16: error: 'LED_BUILTIN' was not declared in this scope
   digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
                ^~~~~~~~~~~
/private/var/folders/7l/3s5_91xs3zv24225c7jfq2mw0000gn/T/.arduinoIDE-unsaved202443-3014-effyou.q418h/Blink/Blink.ino:33:29: error: 'HIGH' was not declared in this scope
   digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
                             ^~~~
/private/var/folders/7l/3s5_91xs3zv24225c7jfq2mw0000gn/T/.arduinoIDE-unsaved202443-3014-effyou.q418h/Blink/Blink.ino:33:3: error: 'digitalWrite' was not declared in this scope
   digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
   ^~~~~~~~~~~~
/private/var/folders/7l/3s5_91xs3zv24225c7jfq2mw0000gn/T/.arduinoIDE-unsaved202443-3014-effyou.q418h/Blink/Blink.ino:34:3: error: 'delay' was not declared in this scope
   delay(1000);                      // wait for a second
   ^~~~~
/private/var/folders/7l/3s5_91xs3zv24225c7jfq2mw0000gn/T/.arduinoIDE-unsaved202443-3014-effyou.q418h/Blink/Blink.ino:35:29: error: 'LOW' was not declared in this scope
   digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
                             ^~~

exit status 1

Compilation error: 'LED_BUILTIN' was not declared in this scope

Which Arduino board are you using and which board is selected in the IDE ?

1 Like

Uno board and Uno AVR selected.

I'm not a Mac user so can't point you to the correct directories. There should be a directory Arduino15 which contains the core(s); it looks like you're missing or have corrupted core files. All errors that you have posted indicate a corrupt Arduino.h file.

What I would try is downgrade the AVR board package and next upgrade again to 1.8.6.

Thanks sterretje. I will do that. I looked in Arduino15 but didn’t know what to look for.

sterretje you deserve a high 5!
I downgraded the AVR board package and upgraded again to 1.8.6.
I can compile with Verify now, sans compile errors.
A board is not nearby, so will test ASAP.
Thanks again.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.