Blink Compiler Error

Hello,

I am new to this forum and this is my first post.

I recently got a UNO and NANO (both clones). I am using Windows 8.1 (64bit) and Arduino 1.8.15. am getting a compiler error when I try to compile and load the sample Blink sketch onto either board. The text of the message is identical except the message says NANO when I'm using the NANO and UNO when I'm using the UNO.

In file included from sketch\Blink.ino.cpp:1:0:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:23:10: fatal error: stdlib.h: No such file or directory

  • #include <stdlib.h>*
  •      ^~~~~~~~~~*
    

compilation terminated.
exit status 1
Error compiling for board Arduino Uno.

I did a search on the site, but did not find a post that matches the problem that I'm having. Someone told me that I have a corrupted library but did not tell me which library was bad. They told me to delete and reinstall the library. I see no way to delete; only how to update or install new libraries so installed Arduio 1.8.15 and reinstalled it. I still get the same error.

I also have an authentic UNO that I used with a older version of Ardunio (that I deleted before installing 1.8.15. The older version compiled and loaded blink to the authentic UNO without errors.

Thank you in advance for suggestions on how to resolve this problem.

The blink sketch doesn't have that line of code in it. Did you modify it?

@IceChes, the error is not in blink.ino but in Arduino.h.

Deleting libraries is done by deleting using the operating system (Windows Explorer). They are in the libraries folder in the sketchbook folder. But if you just started, that folder is probably empty.

It sounds like a corrupted install. Some possibilities that might solve the problem.

  1. Uninstall the IDE, delete C:\Users\yourname\AppData\Local\Arduino15, install the IDE. FGor the latter, I would download a new copy.
  2. Download the zip version of the IDE and extract it to a convenient location. In the directory where you extracted it to, create a directory called portable. Start the IDE by double clicking the exe in the directory where you installed it.
    The portable install will make sure that there is no interference from or with other IDE installations on the PC; this is just to make sure that you basically start with a clean slade.

I didn't modify the sketch in any way. I just clicked File, Examples, 01.Basics, Blink to open the sketch in the IDE and then clicked the Arrow button to compile and load.

Here is the sketch as it shows up in the IDE window.

/*
Blink

Turns an LED on for one second, then off for one second, repeatedly.

Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:
https://www.arduino.cc/en/Main/Products

modified 8 May 2014
by Scott Fitzgerald
modified 2 Sep 2016
by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman

This example code is in the public domain.

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
}

I would do what @sterretje said. I'm not a Windows guy, my PC runs Linux.

The instructions provided by sterretje solved the problem. Uninstalling Arduino left behind over 4,500 files in the Arduino15 folder it took almost 10 minutes to delete them all. I also ran CCleaner and found some Arduino references in the registry which I also deleted. I used the zipped version instead of the Windows installer version of Arduino when I reinstalled. The whole process took almost an hour, but it does work.

Thank you!