exit status 1

i also have this prob. I’m 900% sure that my code is correct, i just change a laptop and this appear, it works perfectly fine with my old dell, but not now…

its just a code that light the LED ring.

can anyone help???

#include <Adafruit_NeoPixel.h>

Adafruit_NeoPixel strip = Adafruit_NeoPixel(12, 0, NEO_GRB + NEO_KHZ800);

//Do not change
#define BLACK strip.Color(0, 0, 0)
#define WHITE strip.Color(127, 127, 127)
#define RED strip.Color(255, 0, 0)
#define GREEN strip.Color(0, 255, 0)
#define BLUE strip.Color(0, 0, 255)
#define YELLOW strip.Color(255, 255, 0)
#define PURPLE strip.Color(127, 0, 127)

#define SPEED 100

void setup() {
pinMode(2, INPUT_PULLUP);
strip.begin();
strip.show();
}

void loop() {
colorWipe(BLACK, SPEED);
while(digitalRead(2) == HIGH);
while(digitalRead(2) == LOW);
delay(100);
colorWipe(RED, SPEED);
while(digitalRead(2) == HIGH);
while(digitalRead(2) == LOW);
delay(100);
colorWipe(GREEN, SPEED);
while(digitalRead(2) == HIGH);
while(digitalRead(2) == LOW);
delay(100);
colorWipe(BLUE, SPEED);
while(digitalRead(2) == HIGH);
while(digitalRead(2) == LOW);
delay(100);
colorWipe(YELLOW, SPEED);
while(digitalRead(2) == HIGH);
while(digitalRead(2) == LOW);
delay(100);
colorWipe(PURPLE, SPEED);
while(digitalRead(2) == HIGH);
while(digitalRead(2) == LOW);
delay(100);
colorWipe(BLACK, SPEED);
spin(GREEN, SPEED/2);
colorWipe(BLACK, 0);
while(digitalRead(2) == HIGH);
while(digitalRead(2) == LOW);
delay(100);
rainbowSpin(5);
}

void colorWipe(uint32_t c, uint8_t wait) {
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}

void rainbowSpin(uint8_t wait) {
uint16_t i, j;

for(j=0; j<256*10; j++) {
for(i=0; i< strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
}
strip.show();
delay(wait);
}

}

void spin(uint32_t c, uint8_t wait) {
for (int j=0; j < 10; j++) {
for(int i=0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, c);
if(i < 12) strip.setPixelColor(i+1, c);
else strip.setPixelColor(0, c);
strip.show();
delay(wait);
strip.setPixelColor(i, 0);
if(i < 12) strip.setPixelColor(i+1, 0);
else strip.setPixelColor(0, 0);
}
}
}

uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

I'm 900% sure that my code is correct

That seems to leave some room for doubt. 8)

It is hardly useful for any of us to compile that code and tell you that it compiles just fine. What problems, EXACTLY, are YOU having?

G'Day People, Sorry to say this is my first post. I also getting similar issue and im still new to C and Arduinos. I get the console text .. .

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

I googled "exit status 1" this page was the 2nd result. Im starting to think it has something to do with the library's. It seems anything to do with microphone frequency code gives me that error. Even the example "SimpleAudioFrequencyMeter" wont compile.

edit: I first thought it was the CPU type, I have UNO, DUE and ESP8266. All same result :(

I get the console text .. .

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

Is that the ONLY message? Typically, that appears after a bunch of other messages.

I’m new to Arduino, my compiler is showing Exit Status 1 for this simple program, Could anyone help??

int ledPin = 13;

void setup()
{
pinMode(ledPin, OUTPUT);

}

void loop()
{
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);

}

I'm new to Arduino, my compiler is showing Exit Status 1 for this simple program

When you do what? For what board? With what version of the IDE?

any one know how to fix this i can attach the code as well if needed

void loop() { int tempreading1 = analogRead (Temp1);

Serial.print ("Switch1Stats"); Serial.print (" ");Serial.println (Switch1); Serial.println(""); Serial.print ("Relay2Stats"); Serial.print (" ");Serial.println (RELAY2STATS); Serial.println(""); Serial.print ("TEMP1Reading"); Serial.print (" ");Serial.println (tempreading1); Serial.println(""); Serial.print ("Relay3Stats"); Serial.print (" ");Serial.println (RELAY3STATS); Serial.println("");

int reading = digitalRead(Switch1); if(reading !=lastButtonState){// reset the debouncing timer lastDebounceTime=millis();} if((millis()- lastDebounceTime)>debounceDelay){//whatever the reading is at, its been there longer for longer //than the debounce delay, so take it as actual current state: //if the button state has changed: if(reading != button1state){ button1state= reading; //only toggle relay if the new button state is high if(button1state == HIGH){Relay2State=!Relay2State; digitalWrite (Relay2,Relay2State); lastButtonState = reading; }

More }s at the end of the code to mate up the the {s.

thx

hello i am having a problem with dht11.h not being recognised by the ide. i have finally got it to be

recognised in dhttester. the library path is setup the same way for both programs yet it wont pickup dht11.h in the following program. i have tried all ways of library setup firstly with way layed out in arduino site and various other ways but no luck i always restart the ide after any change and have restarted pc win7 several times no luck.
arduino ide is 1.6.12.

it has me stumped. ive been working with ibm compats since xt’s and gwbasic etc long before c was invented. i can still work my way around in dos.

please tell me if im having a blonde moment here.

the code i am trying to verify is as follows

//Including Libs

#include "OneWire.h"
#include "VirtualWire.h"
#include "Wire.h" //Pressure sensor
#include "dht11.h"

//Defining Pins


#define DHTPIN 2
#define ONE_WIRE_BUS 10
#define DHTTYPE DHT11   // DHT 11
#define BMP085_ADDRESS 0x77  // I2C address of BMP085 //Pressure sensor

#define INTEGER_MAX (pow(2,31)-1)
#define E_MAX (pow(10, 7))
#define E_MIN (pow(10, -6))
#define EPSILON 0.000000119209

OneWire oneWire(ONE_WIRE_BUS);

int RF_TX_PIN = 12;

//Pressure sensor
const unsigned char OSS = 0;  // Oversampling Setting

// Calibration values
int ac1;
int ac2;
int ac3;
unsigned int ac4;
unsigned int ac5;
unsigned int ac6;
int b1;
int b2;
int mb;
int mc;
int md;

// b5 is calculated in bmp085GetTemperature(...), this variable is also used in bmp085GetPressure(...)
// so ...Temperature(...) must be called before ...Pressure(...).
long b5; 

//Seting up
void setup()
{
  //For Debug
  Serial.begin(9600);
  Serial.println("Setup");

  //Pressure sensor
  Wire.begin();
  bmp085Calibration();

  // Setup transmit pin
  vw_set_tx_pin(RF_TX_PIN); 
  vw_setup(2000); //

  //For Debug
  Serial.println("Start Pressure");
}

//Main Loop
void loop()
{
  Serial.println("\n");

  //First Sensor
  //Humidity
  int chk = DHT11.read(DHT11PIN);

  //Send Data #H is for Humidity
  SendData("#H"+ ((String)DHT11.humidity));



  //Seccond Sensor
  //Temp (Baro Pressure)
  float temperature = bmp085GetTemperature(bmp085ReadUT()); //MUST be called first 

  //Send Data #C is for Celcious
  SendData("#C"+(String(temperature,2)));



  //Same seccond Sensor, next output
  //Baro Pressure
  float pressure = bmp085GetPressure(bmp085ReadUP());

  //Send Data #P is for pressure
  SendData("#P"+(String(pressure/100,2)));


  //Wait for Next Loop
  delay(5000);
}

void SendData(String Data)
{
  //Debug
  Serial.println("-->"+ Data + "<-- ");

  //Making char Array of String
  const char* rawdata = Data.c_str();

  digitalWrite(13, true); // Flash a light to show transmitting
  vw_send((uint8_t *)rawdata, strlen(rawdata)); //Send Data
  vw_wait_tx(); // Wait until the whole message is gone
  digitalWrite(13, false);
}

//Calabration of Barometic sensor
void bmp085Calibration()
{
  ac1 = bmp085ReadInt(0xAA);
  ac2 = bmp085ReadInt(0xAC);
  ac3 = bmp085ReadInt(0xAE);
  ac4 = bmp085ReadInt(0xB0);
  ac5 = bmp085ReadInt(0xB2);
  ac6 = bmp085ReadInt(0xB4);
  b1 = bmp085ReadInt(0xB6);
  b2 = bmp085ReadInt(0xB8);
  mb = bmp085ReadInt(0xBA);
  mc = bmp085ReadInt(0xBC);
  md = bmp085ReadInt(0xBE);
}

// Calculate temperature in deg C
float bmp085GetTemperature(unsigned int ut){
  long x1, x2;

  x1 = (((long)ut - (long)ac6)*(long)ac5) >> 15;
  x2 = ((long)mc << 11)/(x1 + md);
  b5 = x1 + x2;

  float temp = ((b5 + 8)>>4);
  temp = temp /10;

  return temp;
}

// Calculate pressure given up
// calibration values must be known
// b5 is also required so bmp085GetTemperature(...) must be called first.
// Value returned will be pressure in units of Pa.
long bmp085GetPressure(unsigned long up){
  long x1, x2, x3, b3, b6, p;
  unsigned long b4, b7;

  b6 = b5 - 4000;
  // Calculate B3
  x1 = (b2 * (b6 * b6)>>12)>>11;
  x2 = (ac2 * b6)>>11;
  x3 = x1 + x2;
  b3 = (((((long)ac1)*4 + x3)<<OSS) + 2)>>2;

  // Calculate B4
  x1 = (ac3 * b6)>>13;
  x2 = (b1 * ((b6 * b6)>>12))>>16;
  x3 = ((x1 + x2) + 2)>>2;
  b4 = (ac4 * (unsigned long)(x3 + 32768))>>15;

  b7 = ((unsigned long)(up - b3) * (50000>>OSS));
  if (b7 < 0x80000000)
    p = (b7<<1)/b4;
  else
    p = (b7/b4)<<1;

  x1 = (p>>8) * (p>>8);
  x1 = (x1 * 3038)>>16;
  x2 = (-7357 * p)>>16;
  p += (x1 + x2 + 3791)>>4;

  long temp = p;
  return temp;
}

// Read 1 byte from the BMP085 at 'address'
char bmp085Read(unsigned char address)
{
  unsigned char data;

  Wire.beginTransmission(BMP085_ADDRESS);
  Wire.write(address);
  Wire.endTransmission();

  Wire.requestFrom(BMP085_ADDRESS, 1);
  while(!Wire.available())
    ;

  return Wire.read();
}

// Read 2 bytes from the BMP085
// First byte will be from 'address'
// Second byte will be from 'address'+1
int bmp085ReadInt(unsigned char address)
{
  unsigned char msb, lsb;

  Wire.beginTransmission(BMP085_ADDRESS);
  Wire.write(address);
  Wire.endTransmission();

  Wire.requestFrom(BMP085_ADDRESS, 2);
  while(Wire.available()<2)
    ;
  msb = Wire.read();
  lsb = Wire.read();

  return (int) msb<<8 | lsb;
}

// Read the uncompensated temperature value
unsigned int bmp085ReadUT(){
  unsigned int ut;

  // Write 0x2E into Register 0xF4
  // This requests a temperature reading
  Wire.beginTransmission(BMP085_ADDRESS);
  Wire.write(0xF4);
  Wire.write(0x2E);
  Wire.endTransmission();

  // Wait at least 4.5ms
  delay(5);

  // Read two bytes from registers 0xF6 and 0xF7
  ut = bmp085ReadInt(0xF6);
  return ut;
}

// Read the uncompensated pressure value
unsigned long bmp085ReadUP(){

  unsigned char msb, lsb, xlsb;
  unsigned long up = 0;

  // Write 0x34+(OSS<<6) into register 0xF4
  // Request a pressure reading w/ oversampling setting
  Wire.beginTransmission(BMP085_ADDRESS);
  Wire.write(0xF4);
  Wire.write(0x34 + (OSS<<6));
  Wire.endTransmission();

  // Wait for conversion, delay time dependent on OSS
  delay(2 + (3<<OSS));

  // Read register 0xF6 (MSB), 0xF7 (LSB), and 0xF8 (XLSB)
  msb = bmp085Read(0xF6);
  lsb = bmp085Read(0xF7);
  xlsb = bmp085Read(0xF8);

  up = (((unsigned long) msb << 16) | ((unsigned long) lsb << 8) | (unsigned long) xlsb) >> (8-OSS);

  return up;
}

additional info

have found that whatever xxxx.h is on top in the include section then the ide cant find that in the folder in the weather program. have now got the library files for this program in the weather transmitter folder and still got same problems. desperate to sort this as ive bought 5 complete sets of components for presents to family.

I am also having troubles with the exit status 1 error message. I copied the error message.
Arduino: 1.6.11 (Windows 10), Board: “Arduino/Genuino Uno”

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:5:16: error: ‘TKD2’ was not declared in this scope

int RECV_PIN = TKD2; // the pin the IR receiver is connected to

^

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

infrared_Blink.ino (834 Bytes)

PEOPLE, you need to understand that "exit status 1" is the most generic possible error message, it just means that there was an error while compiling. I do appreciate that you searched for the correct thread to post instead of creating a duplicate thread but in this case it really isn't helpful to group them all together by that specific error message(you should be looking at the specific compiler error message).

Ruffnecks22: C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:5:16: error: 'TKD2' was not declared in this scope

int RECV_PIN = TKD2; // the pin the IR receiver is connected to

^

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

The problem is that the wrong IRremote library was included by the Arduino IDE. Try this:

  • Sketch > Include Library > Manage Libraries...
  • Type "IRremote" in the "Filter your search..." box.
  • Click on the "IRremote by shirriff" result.
  • Click "Install".
  • After the installation completes click "Close".
  • Try uploading or compiling your sketch again.

jetdriver55: have now got the library files for this program in the weather transmitter folder and still got same problems.

Please describe the folder structure you're working with, either via text or screenshot from Windows Explorer.

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp

Do you have an official Arduino robot? If not, why do you need to keep this file? Delete it, and problems with compiling the file will go away.

PaulS: Do you have an official Arduino robot? If not, why do you need to keep this file? Delete it, and problems with compiling the file will go away.

The file included in the sketch is IRremote.h, so deleting the file IRremoteTools.cpp would cause a file not found error. Deleting the entire C:\Program Files (x86)\Arduino\libraries\RobotIRremote folder will do the trick, assuming the IRremote library has been installed but every time you update to a new version of the Arduino IDE you will need to delete the RobotIRremote library again so it's better to just properly install the IRremote library, which will give the correct IRremote.h file include priority over the one in the RobotIRremote folder. The Library Manager installation of the library will automatically do this by ensuring that the included file name matches the library folder name.

The file included in the sketch is IRremote.h, so deleting the file IRremoteTools.cpp would cause a file not found error.

Total non-sequitor.

The FILE being compiled, when the error occurs, is IRremoteTools.cpp. Deleting that file will prevent it from being compiled.

When the sketch is compiled, the presence or absence of some other cpp file is completely irrelevant.

The absence of IRremoteTools.cpp might cause a linker error, but that will certainly not involve the phrase "file not found".

PaulS:
Total non-sequitor.

The FILE being compiled, when the error occurs, is IRremoteTools.cpp. Deleting that file will prevent it from being compiled.

When the sketch is compiled, the presence or absence of some other cpp file is completely irrelevant.

The absence of IRremoteTools.cpp might cause a linker error, but that will certainly not involve the phrase “file not found”.

I too have the same error, but with the message:

"C:\Users\Abhishek Gaywala\Documents\Arduino\libraries\SoftwareServo/SoftwareServo.h:4:22: fatal error: WProgram.h: No such file or directory

#include <WProgram.h>"

And as far as I can understand, (from this link: Arduino - BuildProcess) is that Wprogram is the core library.

I’m using a code to run two servos with a joystick, using a pair of NRF24L01 radio, using the RF24 library. this library calls for the use of SoftwareServo library (Downloaded from: http://playground.arduino.cc/uploads/ComponentLib/SoftwareServo.zip), because the regular servo library causes timer conflicts.

How do I replace/repair the Wprogram library? I can’t even delete that library, right?

Abhishek_G:
I too have the same error, but with the message:

"C:\Users\Abhishek Gaywala\Documents\Arduino\libraries\SoftwareServo/SoftwareServo.h:4:22: fatal error: WProgram.h: No such file or directory

#include <WProgram.h>"

And as far as I can understand, (from this link: Arduino - BuildProcess) is that Wprogram is the core library.

I’m using a code to run two servos with a joystick, using a pair of NRF24L01 radio, using the RF24 library. this library calls for the use of SoftwareServo library (Downloaded from: http://playground.arduino.cc/uploads/ComponentLib/SoftwareServo.zip), because the regular servo library causes timer conflicts.

How do I replace/repair the Wprogram library? I can’t even delete that library, right?

Okay, so I’m answering my own question.

I did a little bit of digging, and came to know that Wprogram.h is an outdated file. The newer versions of the IDE support the Arduino.h file.
So all I had to do was to replace the “#include Wprogram.h” with “#include Arduino.h” in the SoftwareServo header files, and then I was good to go.

Glad to have found this thread.

Had the same problem too. Need help with this coding. Currently using genuino 101 board.

/*
* The code is released under the GNU General Public License.
* Developed by www.codekraft.it 
*/

#include "CurieImu.h"

// IMU
float FS_SEL = 131;                                  // IMU gyro values to degrees/sec
unsigned long last_read_time;
float angle_x, angle_y, angle_z;                     // These are the result angles
float last_x_angle, last_y_angle, last_z_angle;      // These are the filtered angles
float lGXA, lGYA, lGZA;                              // Store the gyro angles to compare drift

// FUNCTIONS
//Math
//Convert radians to degrees
double rtod(double fradians) {return(fradians * 180.0 / PI);}

void set_last_read_angle_data(unsigned long time, float x, float y, float z, float x_gyro, float y_gyro, float z_gyro) {
  last_read_time = time;
  last_x_angle = x; last_y_angle = y; last_z_angle = z;
  lGXA = x_gyro; lGYA = y_gyro; lGZA = z_gyro;
}

void setup() {
  
  Serial.begin(9600);
  while (!Serial);

  // init CurieImu
  CurieImu.initialize();
  // use the code below to calibrate accel/gyro offset values
  Serial.println("Internal sensor offsets BEFORE calibration...");
  Serial.print(CurieImu.getXAccelOffset()); 
  Serial.print("\t"); // -76
  Serial.print(CurieImu.getYAccelOffset()); 
  Serial.print("\t"); // -235
  Serial.print(CurieImu.getZAccelOffset()); 
  Serial.print("\t"); // 168
  Serial.print(CurieImu.getXGyroOffset()); 
  Serial.print("\t"); // 0
  Serial.print(CurieImu.getYGyroOffset()); 
  Serial.print("\t"); // 0
  Serial.println(CurieImu.getZGyroOffset());
  Serial.println("About to calibrate. Make sure your board is stable and upright");
  delay(1000);
  // The board must be resting in a horizontal position for 
  // the following calibration procedure to work correctly!
  Serial.print("Starting Gyroscope calibration...");
  CurieImu.autoCalibrateGyroOffset();
  Serial.println(" Done");
  Serial.print("Starting Acceleration calibration...");
  CurieImu.autoCalibrateXAccelOffset(0);
  CurieImu.autoCalibrateYAccelOffset(0);
  CurieImu.autoCalibrateZAccelOffset(1);
  Serial.println(" Done");
  Serial.println("Enabling Gyroscope/Acceleration offset compensation");
  CurieImu.setGyroOffsetEnabled(true);
  CurieImu.setAccelOffsetEnabled(true);

  set_last_read_angle_data(millis(), 0, 0, 0, 0, 0, 0);
}

void loop() {
  unsigned long t_now = millis();
  int ax = CurieImu.getAccelerationX();
  int ay = CurieImu.getAccelerationY();
  int az = CurieImu.getAccelerationZ();
  int gx = CurieImu.getRotationX();
  int gy = CurieImu.getRotationY();
  int gz = CurieImu.getRotationZ();


  // Convert gyro values to degrees/sec
  float gyro_x = gx/FS_SEL;
  float gyro_y = gy/FS_SEL;
  float gyro_z = gz/FS_SEL;

   // Compute the accel angles
  float accelX = rtod(atan(ay / sqrt( pow(ax, 2) + pow(az, 2))));
  float accelY = rtod(-1 * atan(ax/sqrt(pow(ay,2) + pow(az,2))));
  
  // Compute the (filtered) gyro angles
  float dt =(t_now - last_read_time)/1000.0;
  float gyroX = gyro_x*dt + last_x_angle;
  float gyroY = gyro_y*dt + last_y_angle;
  float gyroZ = gyro_z*dt + last_z_angle;  

  // Compute the drifting gyro angles
  float unfiltered_gyro_angle_x = gyro_x*dt + lGXA;
  float unfiltered_gyro_angle_y = gyro_y*dt + lGYA;
  float unfiltered_gyro_angle_z = gyro_z*dt + lGZA;
  
  // Apply the complementary filter to figure out the change in angle 
  // Alpha depends on the sampling rate...
  float alpha = 0.96;
  angle_x = alpha*gyroX + (1.0 - alpha)*accelX;
  angle_y = alpha*gyroY + (1.0 - alpha)*accelY;
  angle_z = gyroZ;  //Accelerometer doesn't give z-angle

  // Update the saved data with the latest values
  set_last_read_angle_data(t_now, angle_x, angle_y, angle_z, unfiltered_gyro_angle_x, unfiltered_gyro_angle_y, unfiltered_gyro_angle_z);

  Serial.print("Y:" );
  Serial.print(angle_y);
  Serial.print("  \t Z:" );
  Serial.print(angle_z);
  Serial.print("  \t X:" );
  Serial.println(angle_x); 

}