exit status 1 error

Could someone explain what a exit status 1 and compiling error is?

Thank you

#include <CompactQik2s9v1.h>    // From pololu.com or ARB Support Site
#include <SoftwareSerial.h>

#define rxPin 5
#define txPin 6
#define rstPin 7

SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);
CompactQik2s9v1 motor = CompactQik2s9v1(&mySerial,rstPin);

void setup() {
  mySerial.begin(9600);
  motor.begin();
  motor.stopBothMotors();
}

void loop() {
  // Both motors forward
  doDelay();
  motor.motor0Forward(127);    // Left motor
  motor.motor1Forward(127);    // Right motor
  delay (2000);

  // Both motors reverse
  doDelay();
  motor.motor0Reverse(127);
  motor.motor1Reverse(127);  
  delay (2000);

  // Turn left
  doDelay();
  motor.motor0Reverse(127);
  motor.motor1Forward(127);  
  delay (2000);  

  // Turn right
  doDelay();
  motor.motor0Forward(127);
  motor.motor1Reverse(127);
  delay (2000);  
}

void doDelay() {    // Short delay between transitions
  motor.motor0Forward(0);
  motor.motor1Forward(0);  
  delay (250);
}

It means that something went wrong :D. You should provide the full error message; when I compile your code, I get

C:\Users\Wim Sturkenboom\Documents\Arduino\Projects\Forums\test\test.ino:3:71: fatal error: CompactQik2s9v1.h: No such file or directory

 #include <CompactQik2s9v1.h>    // From pololu.com or ARB Support Site

                                                                       ^

compilation terminated.

exit status 1
Error compiling.

This indicates that it can't find the include file (which I indeed don't have).

If I compile something like

void doIt();

void setup()
{
  doIt();
}

void loop()
{
  
}

I get

sketch\test.ino.cpp.o: In function `setup':

C:\Users\Wim Sturkenboom\Documents\Arduino\Projects\Forums\test/test.ino:6: undefined reference to `doIt()'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling.

This is because the linker could not find the function doIt(); there is only a prototype for it, not the actual function.

So something like exit status 1 does not mean much :wink:

For this code showed exit status 1 for an arduino/genuino board .. Can anbody give any suggestion for resolving this problem??

CODE

#include <SPI.h>
#include <MySensor.h>
#include <Wire.h>

#define CHILD_ID_AIQ 0
#define AIQ_SENSOR_ANALOG_PIN 0

#define MQ135_DEFAULTPPM 399 //default ppm of CO2 for calibration
#define MQ135_DEFAULTRO 68550 //default Ro for MQ135_DEFAULTPPM ppm of CO2
#define MQ135_SCALINGFACTOR 116.6020682 //CO2 gas value
#define MQ135_EXPONENT -2.769034857 //CO2 gas value
#define MQ135_MAXRSRO 2.428 //for CO2
#define MQ135_MINRSRO 0.358 //for CO2

unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in seconds)
//VARIABLES
float mq135_ro = 10000.0; // this has to be tuned 10K Ohm
int val = 0; // variable to store the value coming from the sensor
float valAIQ =0.0;
float lastAIQ =0.0;

MySensor gw;
MyMessage msg(CHILD_ID_AIQ, V_LEVEL);

void setup()
{
gw.begin();

// Send the sketch version information to the gateway and Controller
gw.sendSketchInfo("AIQ Sensor MQ135", "1.0");

// Register all sensors to gateway (they will be created as child devices)
gw.present(CHILD_ID_AIQ, S_AIR_QUALITY);

}

/*

  • get the calibrated ro based upon read resistance, and a know ppm
    */
    long mq135_getro(long resvalue, double ppm) {
    return (long)(resvalue * exp( log(MQ135_SCALINGFACTOR/ppm) / MQ135_EXPONENT ));
    }

/*

  • get the ppm concentration
    */
    double mq135_getppm(long resvalue, long ro) {
    double ret = 0;
    double validinterval = 0;
    validinterval = resvalue/(double)ro;
    if(validinterval<MQ135_MAXRSRO && validinterval>MQ135_MINRSRO) {
    ret = (double)MQ135_SCALINGFACTOR * pow( ((double)resvalue/ro), MQ135_EXPONENT);
    }
    return ret;
    }

void loop()
{
uint16_t valr = analogRead(AIQ_SENSOR_ANALOG_PIN);// Get AIQ value
Serial.println(val);
uint16_t val = ((float)22000*(1023-valr)/valr);
//during clean air calibration, read the Ro value and replace MQ135_DEFAULTRO value with it, you can even deactivate following function call.
mq135_ro = mq135_getro(val, MQ135_DEFAULTPPM);
//convert to ppm (using default ro)
valAIQ = mq135_getppm(val, MQ135_DEFAULTRO);

Serial.print ( "Val / Ro / value:");
Serial.print ( val);
Serial.print ( " / ");
Serial.print ( mq135_ro);
Serial.print ( " / ");
Serial.print ( valAIQ);

if (valAIQ != lastAIQ) {
gw.send(msg.set(MQ135_DEFAULTPPM+(int)ceil(valAIQ)));
lastAIQ = ceil(valAIQ);
}

// Power down the radio. Note that the radio will get powered back up
// on the next write() call.
gw.sleep(SLEEP_TIME); //sleep for: sleepTime
}

/***************************** MQGetPercentage **********************************
Input: rs_ro_ratio - Rs divided by Ro
pcurve - pointer to the curve of the target gas
Output: ppm of the target gas
Remarks: By using the slope and a point of the line. The x(logarithmic value of ppm)
of the line could be derived if y(rs_ro_ratio) is provided. As it is a
logarithmic coordinate, power of 10 is used to convert the result to non-logarithmic
value.
************************************************************************************/
int MQGetPercentage(float rs_ro_ratio, float ro, float *pcurve)
{
return (double)(pcurve[0] * pow(((double)rs_ro_ratio/ro), pcurve[1]));
}

Please give the entire error message. Exit status 1 is just the last line that says it couldn't go on past the error. There are lines before that that tell what the actual error was.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom... :slight_smile:

I have facing " exit status 1" problem. Can you please help me?

#include <dht.h>

dht DHT;

#define DHT11_PIN 5

void setup()
{
  Serial.begin(115200);
  Serial.println("DHT TEST PROGRAM ");
  Serial.print("LIBRARY VERSION: ");
  Serial.println(DHT_LIB_VERSION);
  Serial.println();
  Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)");
}

void loop()
{
  // READ DATA
  Serial.print("DHT11, \t");
  int chk = DHT.read11(DHT11_PIN);
  switch (chk)
  {
    case DHTLIB_OK:  
                Serial.print("OK,\t"); 
                break;
    case DHTLIB_ERROR_CHECKSUM: 
                Serial.print("Checksum error,\t"); 
                break;
    case DHTLIB_ERROR_TIMEOUT: 
                Serial.print("Time out error,\t"); 
                break;
    case DHTLIB_ERROR_CONNECT:
        Serial.print("Connect error,\t");
        break;
    case DHTLIB_ERROR_ACK_L:
        Serial.print("Ack Low error,\t");
        break;
    case DHTLIB_ERROR_ACK_H:
        Serial.print("Ack High error,\t");
        break;
    default: 
                Serial.print("Unknown error,\t"); 
                break;
  }
  // DISPLAY DATA
  Serial.print(DHT.humidity, 1);
  Serial.print(",\t");
  Serial.println(DHT.temperature, 1);

  delay(2000);
}
//
// END OF FILE
//

........................

fakrul:
I have facing " exit status 1" problem. Can you please help me?

#include <dht.h>

dht DHT;

#define DHT11_PIN 5

void setup()
{
  Serial.begin(115200);
  Serial.println("DHT TEST PROGRAM ");
  Serial.print("LIBRARY VERSION: ");
  Serial.println(DHT_LIB_VERSION);
  Serial.println();
  Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)");
}

void loop()
{
  // READ DATA
  Serial.print("DHT11, \t");
  int chk = DHT.read11(DHT11_PIN);
  switch (chk)
  {
    case DHTLIB_OK: 
                Serial.print("OK,\t");
                break;
    case DHTLIB_ERROR_CHECKSUM:
                Serial.print("Checksum error,\t");
                break;
    case DHTLIB_ERROR_TIMEOUT:
                Serial.print("Time out error,\t");
                break;
    case DHTLIB_ERROR_CONNECT:
        Serial.print("Connect error,\t");
        break;
    case DHTLIB_ERROR_ACK_L:
        Serial.print("Ack Low error,\t");
        break;
    case DHTLIB_ERROR_ACK_H:
        Serial.print("Ack High error,\t");
        break;
    default:
                Serial.print("Unknown error,\t");
                break;
  }
  // DISPLAY DATA
  Serial.print(DHT.humidity, 1);
  Serial.print(",\t");
  Serial.println(DHT.temperature, 1);

delay(2000);
}
//
// END OF FILE
//



........................

@fakrul, Did you read the other replies stating that you should post the complete error message.

And what is that '\t' in your serial prints? Serial.print'ing text does not work like that

fakrul the pane where the error is, is a) scrollable and b) expandable.

sterretje:
And what is that '\t' in your serial prints?

What's your problem with tab characters?

Whandall:
What's your problem with tab characters?

Corrected, thought that tab was used as the second argument.

Hi
It compiles for me. WIN7 IDE 1.8.0.

What is your OS and IDE version?

Tom... :slight_smile:

TomGeorge:
Hi
It compiles for me. WIN7 IDE 1.8.0.

What is your OS and IDE version?

You probably have the dht library and OP doesn't, because it fell over for me.

Well the mystery continues. I too am having the exit status 1 no matter which program from the example library I try to compile. Tried both the windows install version and download zip version extracted to a folder in windows 7. So went back and installed 1.6.5 r5 and the sketch compiled but couldn't establish connection with the usb port. Windows 7 sees the port as usb2.0 but Ide doesn't see the port. From my years of experience some very serious code problems in the Arduino IDE exist. Guess they should have stayed with processing instead of changing to java. Too bad was a great system guess I'll go back to eclipse.

Guess they should have stayed with processing instead of changing to java

What the Hell does that mean?

You've been registered here for eight and a half years, this is your first post and you necro a year plus old post?

Smells bad. Smells real bad.