Exit status 1, Error compiling for board Arduino/Genuino Uno. [Solved!]

I just got my Arduino and have almost no experience with it. I bought a beginners book with some C coding basics and several Arduino projects to get started. I am in my fifth project (a set of 10 LED's that turn on and off in a sequence) and, for the first time, I am getting a compiling code error that I cannot figure out how to solve. This is my code:

//proyect 5 - LED Chase Effect
byte ledPin[] = {4,5,6,7,8,9,10,11,12,13};
//create array for LED pins
int ledDelay(65);
//delay between changes
int direction = 1;
int currentLED = 0;
unsigned long changeTime;

void setup() {
for (int x=0; x<10; x++)
{ //set all pins to output
pinMode(ledPin[ x ]. OUTPUT);
}
changeTime = millis();
}

void loop(){
if((millis() - changeTime) > ledDelay) {
//if it has been ledDelay ms since last change
changeLED();
changeTime = millis();
}
}

void changeLED(){
for (int x=0; x<10; x++)
{ //turn off all LED's
digitalWrite(ledPin[ x ], LOW);
}
digitalWrite(ledPin[currentLED], HIGH);
//turn on the current LED
currentLED += direction;
//increment by the direction value
//change direction if we reach end
if (currentLED == 9)
{direction = -1;}
if (currentLED == 0)
{direction = 1;}
}

And this is the error that I get:

exit status 1
Error compiling for board Arduino/Genuino Uno.

How can I solve this?

Thanks for the help!

franpernice:
And this is the error that I get:

exit status 1
Error compiling for board Arduino/Genuino Uno.

That is not the complete error because it should give you the line number of the error.

Please read the post by Nick Gammon at the top of this Forum about the proper way to post code using code tags. Also, before posting, use Ctrl-T in the IDE to reformat your code into a standard style. These changes will help us help you.

You have a period where a comma should be:

...
pinMode(ledPin[ x ]. OUTPUT);
...

Except for using code tags. the following

Place your cursor in the output window, scroll up and look at ALL orange lines to determine what goes wrong. Copy and paste them here.

In file included from C:\Users\sterretje\AppData\Local\Temp\build23a1ad29cfbc8c1befc710952816a949.tmp\sketch\sketch_jul03a.ino.cpp:1:0:

C:\Users\sterretje\AppData\Local\Temp\arduino_23a1ad29cfbc8c1befc710952816a949\sketch_jul03a.ino: In function 'void setup()':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:44:16: error: expected unqualified-id before numeric constant

 #define OUTPUT 0x1

                ^

C:\Users\sterretje\AppData\Local\Temp\arduino_23a1ad29cfbc8c1befc710952816a949\sketch_jul03a.ino:14:26: note: in expansion of macro 'OUTPUT'

     pinMode(ledPin[ x ]. OUTPUT);

                          ^

exit status 1
Error compiling.

Although one usually handles errors from top to bottom, in this case you have to turn it around and have a look at the 'pinMode' line. Hint: pinMode takes two arguments, you only pass it one.

ChrisTenone, you solved the problem! I had a dot instead of a comma here:
...
pinMode(ledPin[ x ]. OUTPUT);
...

Stupid mistake, but it wasn't showing up in the error window, I don't know why. Anyways, thanks for the help!

It deos show up in the error window as I showed in reply #4

#include <LiquidCrystal.h> //Include LCD library
#include <GSM.h> // Include the GSM library
#include <SoftwareSerial.h>

SoftwareSerial mySerial(9, 10); // RX,TX
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // initialize the library with the numbers of the interface pins
GSM gsmAccess; // initialize the library instance
GSM_SMS sms;

void SetAlert()
{
int sms_count = 1;
float Fire_Set;
while (sms_count < 3) //Number of SMS Alerts to be sent
{
SendTextMessage(); // Function to send AT Commands to GSM module
}
Fire_Set = 1;
lcd.setCursor(0, 1);
lcd.print("Gas Alert!SMS Sent");
}

void SendTextMessage()
{
int sms_count;
mySerial.println("AT+CMGF=1"); //To send SMS in Text Mode
delay(2000);
mySerial.println("AT+CMGS="+96171797525"\r"); // change to the phone number you using
delay(2000);
mySerial.println("GAS IN THE KITCHEN HURRY UP");//the content of the message
delay(200);
mySerial.println((char)50);//the stopping character
delay(5000);

sms_count++;
}

int potPin = A4;
int potValue = 0;
int buzzer = 6;
int sms_count = 0;

void setup() {

lcd.begin(16, 2); // lcd rows and columns
lcd.print("GAS SENSOR");
pinMode(6, OUTPUT);
mySerial.begin(9600);
Serial.begin(9600);
lcd.begin(16, 2);
delay(500);
}

void loop() {

potValue = analogRead(potPin);

lcd.setCursor(0, 1);
lcd.print("Value = ");
lcd.print(potValue);
delay(1000);
lcd.print(" ");
delay(1);

if (potValue > 200)

{
SetAlert(); // Function to send SMS Alerts
digitalWrite(6, HIGH); // 6 is the digital pin on arduino connected to buzzer
delay(100);
}
}

i got this error

When I compiled your code, I got:

SoftwareSerial\SoftwareSerial.cpp.o: In function __vector_3': C:\Users\PaulS\Documents\Arduino_160\hardware\arduino\avr\libraries\SoftwareSerial/SoftwareSerial.cpp:227: multiple definition of __vector_3'
GSM\GSM3SoftSerial.cpp.o:C:\Users\PaulS\Documents\Arduino_160\libraries\GSM\src/GSM3SoftSerial.cpp:499: first defined here

SoftwareSerial\SoftwareSerial.cpp.o: In function SoftwareSerial::read()': C:\Users\PaulS\Documents\Arduino_160\hardware\arduino\avr\libraries\SoftwareSerial/SoftwareSerial.cpp:392: multiple definition of __vector_4'
GSM\GSM3SoftSerial.cpp.o:C:\Users\PaulS\Documents\Arduino_160\libraries\GSM\src/GSM3SoftSerial.cpp:487: first defined here

SoftwareSerial\SoftwareSerial.cpp.o: In function SoftwareSerial::read()': C:\Users\PaulS\Documents\Arduino_160\hardware\arduino\avr\libraries\SoftwareSerial/SoftwareSerial.cpp:392: multiple definition of __vector_5'
GSM\GSM3SoftSerial.cpp.o:C:\Users\PaulS\Documents\Arduino_160\libraries\GSM\src/GSM3SoftSerial.cpp:487: first defined here
collect2.exe: error: ld returned 1 exit status
Error compiling.

You can NOT use SoftwareSerial and GSM at the same time.

Hi George, please do not hijack someone else's thread. Start your own and read the guidelines.
Thanks.

Using Arduino 1.8, uninstalled and re-installed Arduino

6 core, 16 gig RAM, 4k monitor, 8 gig video. Windows 10, McAafee .

just purchased 2 Adruino UNO (not clone or knock offs, original)

getting the following error when trying to verify (or compile) the "blink" program

or any other one as well.

A-HA, THE ISSUE IS THE McAfee VIRUS DETECTION PROGRAM
TURNED IT OFF AND EVERYTHING WORKS GREAT

Arduino: 1.8.0 (Windows 10), Board: "Arduino/Genuino Uno"

.
.
c:\arduino\hardware\tools\avr\bin../lib/gcc/avr/4.9.2/../../../../avr/bin/ar.exe:
unable to rename
'C:\Users\JAZYCO~1\AppData\Local\Temp\arduino_build_641869\core\core.a';
reason: Permission denied

exit status 1
Error compiling for board Arduino/Genuino Uno.

Thanks for any input

Howzit guys I am having the same problem. tried everything here but no luck getting it to work. Any advice???

I am using an Arduino Uno R3 and an Elecfreaks CANBUS shield.

I am not sure whats going on whether I need to upload another library (got the code off a site where they used a sparkfun CANBUS shield)

My code is as follows:

#include <Canbus.h> // don't forget to include these
#include <defaults.h>
#include <global.h>
#include <mcp2515.h>
#include <mcp2515_defs.h>

void setup() {

Serial.begin(9600); // For debug use
Serial.println("CAN Read - Testing receival of CAN Bus message");
delay(1000);

if (Canbus.init(CANSPEED_500)) //Initialise MCP2515 CAN controller at the specified speed
Serial.println("CAN Init ok");
else
Serial.println("Can't init CAN");

delay(1000);
}

void loop() {

tCAN message;
if (mcp2515_check_message())
{
if (mcp2515_get_message(&message))
{
if (message.id == 0x620 and message.data[2] == 0xFF) //uncomment when you want to filter
{

Serial.print("ID: ");
Serial.print(message.id, HEX);
Serial.print(", ");
Serial.print("Data: ");
Serial.print(message.header.length, DEC);

for (int i = 0; i < message.header.length; i++)
{
Serial.print(message.data*, HEX);*

  • Serial.print(" ");*
  • }*
  • Serial.println("");*
  • }*
  • }*
  • }*
    }
    [/quote]
    The error code is as follows:
    > Arduino: 1.6.13 (Windows 10), Board: "Arduino/Genuino Uno"
    > fatal error: Canbus.h: No such file or directory
    >
    > #include <Canbus.h> // don't forget to include these
    >
    > compilation terminated.
    >
    > exit status 1
    > Error compiling for board Arduino/Genuino Uno.

@JacquesNel

Please post code using code tags so the code does not randomly changes to italics and info falls away. Please edit your post.

You have not installed the library or installed it incorrectly.

Apologies for that will do that in the future.

I have installed the CAN BUS library and have been sending messeges over CANBUS from one arduino to the other as a test and everything worked perfectly. Could it be that I need another library added?

I have read that some guys install the Seeed library do you think this will fix my problem

thanks for the reply

Arduino: 1.8.1 (Windows Store 1.8.1.0) (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\noupa\AppData\Local\Temp\Temp1_RFIDuinoLibrary-master.zip\RFIDuinoLibrary-master\RFIDuino\examples\RFIDuino_helloWorld\RFIDuino_helloWorld.ino:36:53: fatal error: RFIDuino.h: No such file or directory

#include <RFIDuino.h> //include the RFIDuino Library

^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I am new to this stuff but love it.
Does anyone know why this error show and I am unable to compile or upload Hello World and Demo3 for IFID project. Please help! Thanks,

@MyNameIsNoukane

It looks like you're directly opening the ino file from within the zip file; I might be wrong. Not sure if that will work.

If you're indeed opening the ino file in the zip file, extract the zip file to a directory of choice first and next open the ino file in that directory; next compile.

#include
int RECV_PIN = 3;
IRrecv irrecv(RECV_PIN);
decode-results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn();
pinMode(13,OUTPUT);
}
void loop()
{
if (irrecv.decode(&results)) {// irrecv.decode(&results)
Serial.println(results.value, HEX);
if(results.value==0xFA08F7)
{
digitalWrite(13,HIGH);
else
digitalWrite(13,LOW);
delay(300);
irrecv.resume ();
}
}

Exit status 1
Error compiling for board arduino/genuino uno

#include

Include what?

not sure why

but I removed the in-line comments and now I can compile.

Guys,
I'm a newbie and trying to do a home-security system for school project. I did research on the internet an found a site with subject. Unfortunately, when I tried to run mine, I keep getting compile error (exit 1). I went line by line and could not find anything.
Can you pleas help? Thank you in advance.

#include <Keypad.h>
#include<LiquidCrystal.h>
#include<EEPROM.h>
LiquidCrystal lcd(9, 8, 7, 6, 5, 4);
char password[4];
char pass[4], pass1[4];
int i = 0;
char customKey = 0;
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char hexaKeys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {A0, A1, A2, A3}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {A4, A5, 3, 2}; //connect to the column pinouts of the keypad
//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
int led;
int buzzer = 10;
int m11;
int m12;
void setup()
{
Serial.begin(9600);
pinMode(11, OUTPUT);

lcd.begin(16, 2);
pinMode(led, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(m11, OUTPUT);
pinMode(m12, OUTPUT);
lcd.print(" Electronic ");
Serial.print(" Electronic ");
lcd.setCursor(0, 1);
lcd.print(" Keypad Lock ");
Serial.print(" Keypad Lock ");
delay(2000);
lcd.clear();
lcd.print("Enter Ur Passkey:");
Serial.println("Enter Ur Passkey:");
lcd.setCursor(0, 1);
for (int j = 0; j < 4; j++)
EEPROM.write(j, j + 49);
for (int j = 0; j < 4; j++)
pass[j] = EEPROM.read(j);
}

void loop()
{
digitalWrite(11, HIGH);
customKey = customKeypad.getKey();
if (customKey == '#')
change();
if (customKey)
{
password[i++] = customKey;
lcd.print(customKey);
Serial.print(customKey);
beep();
}
if (i == 4)
{
delay(200);
for (int j = 0; j < 4; j++)
pass[j] = EEPROM.read(j);
if (!(strncmp(password, pass, 4)))
{
digitalWrite(led, HIGH);
beep();
lcd.clear();
lcd.print("Passkey Accepted");
Serial.println("Passkey Accepted");
digitalWrite(11, LOW);
delay(2000);
lcd.setCursor(0, 1);
lcd.print("#.Change Passkey");
Serial.println("#.Change Passkey");
delay(2000);
lcd.clear();
lcd.print("Enter Passkey:");
Serial.println("Enter Passkey:");
lcd.setCursor(0, 1);
i = 0;
digitalWrite(led, LOW);
}
else
{
digitalWrite(11, HIGH);
digitalWrite(buzzer, HIGH);
lcd.clear();
lcd.print("Access Denied...");
Serial.println("Access Denied...");
lcd.setCursor(0, 1);
lcd.print("#.Change Passkey");
Serial.println("#.Change Passkey");
delay(2000);
lcd.clear();
lcd.print("Enter Passkey:");
Serial.println("Enter Passkey:");
lcd.setCursor(0, 1);
i = 0;
digitalWrite(buzzer, LOW);
}
}
}
void change()
{
int j = 0;
lcd.clear();
lcd.print("UR Current Passk");
Serial.println("UR Current Passk");
lcd.setCursor(0, 1);
while (j < 4)
{
char key = customKeypad.getKey();
if (key)
{
pass1[j++] = key;
lcd.print(key);
Serial.print(key);
beep();
}
key = 0;
}
delay(500);

if ((strncmp(pass1, pass, 4)))
{
lcd.clear();
lcd.print("Wrong Passkey...");
Serial.println("Wrong Passkey...");
lcd.setCursor(0, 1);
lcd.print("Better Luck Again");
Serial.println("Better Luck Again");
delay(1000);
}
else
{
j = 0;
lcd.clear();
lcd.print("Enter New Passk:");
Serial.println("Enter New Passk:");
lcd.setCursor(0, 1);
while (j < 4)
{
char key = customKeypad.getKey();
if (key)
{
pass[j] = key;
lcd.print(key);
Serial.print(key);
EEPROM.write(j, key);
j++;
beep();
}
}
lcd.print(" Done......");
Serial.println(" Done......");
delay(1000);
}
lcd.clear();
lcd.print("Enter Ur Passk:");
Serial.println("Enter Ur Passk:");
lcd.setCursor(0, 1);
customKey = 0;
}
void beep()
{
digitalWrite(buzzer, HIGH);
delay(20);
digitalWrite(buzzer, LOW);
}