system
July 19, 2014, 9:59am
1
I have installed the cozir library 1.0.3 for the cozir co2 module in Arduino 1.0.5 on ubuntu. When I try to compile I get the error :-
cozir.cpp:14:19: error: Cozir.h: No such file or directory
then others caused by this, even though the Cozir.h file is installed in the same directory.
What mistake am I making ?
If I comment out //#include "cozir.h" from the code below I get the error
error: ‘COZIR’ does not name a type
#include <SoftwareSerial.h>
#include "cozir.h"
SoftwareSerial nss(3,2);
COZIR czr(nss);
void setup()
{
Serial.begin(9600);
Serial.println("Setup");
delay(1000);
}
void loop()
{
Serial.println("Loop");
float t = czr.Celsius();
float f = czr.Fahrenheit();
float h = czr.Humidity();
uint16_t c = czr.CO2();
Serial.print("Celcius = ");Serial.println(t);
Serial.print("Fahrenheit = ");Serial.println(f);
Serial.print("Humidity = ");Serial.println(h);
Serial.print("CO2 = ");Serial.println(c);
delay(3000);
}
check if the include is case sensitive.
cozir.h --> Cozir.h
The include statement in the .cpp file should be identical to the include in your sketch and identical to the actual .h file name.
hope this helps,
I have installed the cozir library 1.0.3 for the cozir co2 module in Arduino 1.0.5 on ubuntu.
Where exactly is the file installed ?
Using
#include "cozir.h"the header file should be in the same directory as you program.
Compare that with #include <SoftwareSerial.h>which indicates that the header file is in the libraries folder.
If I comment out //#include "cozir.h" from the code below I get the error
error: ‘COZIR’ does not name a type
COZIR is undefind for compiler because compiler does not able to find out cozir.h (for definition).
system
July 19, 2014, 11:16am
5
The library is in the arduino/libraries folder.
I changed the include in the sketch to #include <cozir.h> and the declaration in the cpp file from Cozir to cozir
It now works many thanks for all the help.