Go Down

Topic: Exit status 1, Error compiling for board Arduino/Genuino Uno. [Solved!] (Read 197800 times) previous topic - next topic

franpernice

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!

ieee488


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.


econjack

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.

ChrisTenone

You have a period where a comma should be:
Code: [Select]

...
pinMode(ledPin[ x ]. OUTPUT);
...
What, I need to say something else too?

sterretje

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.

Code: [Select]

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.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

franpernice

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!

sterretje

It deos show up in the error window as I showed in reply #4
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Georges-33

#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

PaulS

When I compiled your code, I got:
Quote
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.
The art of getting good answers lies in asking good questions.

ChrisTenone

Hi George, please do not hijack someone else's thread.  Start your own and read the guidelines.
Thanks.
What, I need to say something else too?

larystoy

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


JacquesNel

#11
Jan 16, 2017, 02:37 pm Last Edit: Jan 17, 2017, 10:16 am by JacquesNel Reason: Posted code without quote tags
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:
Quote
#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("");
     }
   }
 }

}
The error code is as follows:

Quote
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.

sterretje

@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.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

JacquesNel

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

MyNameIsNoukane

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,

Go Up