Question

I wrote this code, but Arduino UNO reports this error and I do not know how to get it fixed. This code and who can check it. Thanks in advance

#include <DHT.h>
#include <LiquidCrystal_I2C.h>
#define DHTPin 2                        //define DHT pin
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
DHT dht;
void setup() {
  dht.setup(DHTPin);  
  lcd.begin(16,2);                      //initializes the LCD and specifies the dimensions
}
void loop() {
  float temp = dht.getTemperature();
  float humi = dht.getHumidity();
  lcd.setCursor(0,0);
  lcd.print("Temp: ");
  lcd.print(temp);
  lcd.print(" C");
  lcd.setCursor(0,1);
  lcd.print("Humi: ");
  lcd.print(humi);
  lcd.print(" %");
  delay(2000);
}

Error:

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

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

I wrote this code, but Arduino reports this error and I do not know how to get it fixed. This code and who can check it. Thanks in advance

#include <DHT.h>
#include <LiquidCrystal_I2C.h>
#define DHTPin 2                        //define DHT pin
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
DHT dht;
void setup() {
 dht.setup(DHTPin);  
 lcd.begin(16,2);                      //initializes the LCD and specifies the dimensions
}
void loop() {
 float temp = dht.getTemperature();
 float humi = dht.getHumidity();
 lcd.setCursor(0,0);
 lcd.print("Temp: ");
 lcd.print(temp);
 lcd.print(" C");
 lcd.setCursor(0,1);
 lcd.print("Humi: ");
 lcd.print(humi);
 lcd.print(" %");
 delay(2000);
}

Error

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

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

Cross posted in Project Guidance.

Use code tags.

Threads merged.

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

What Arduino board are you using?

Please follow the advice given in reply #1

This error means, probably, that you haven't got one or more library that yoir code need. I don't know what library is, but you control to have installed everyone

I wrote this code, but Arduino UNO reports this error and I do not know how to get it fixed. This code and who can check it. Thanks in advance.

Code

#include <DHT.h>
#include <LiquidCrystal_I2C.h>
#define DHTPin 2 //define DHT pin
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
DHT dht;
void setup() {
dht.setup(DHTPin);
lcd.begin(16,2); //initializes the LCD and specifies the dimensions
}
void loop() {
float temp = dht.getTemperature();
float humi = dht.getHumidity();
lcd.setCursor(0,0);
lcd.print("Temp: ");
lcd.print(temp);
lcd.print(" C");
lcd.setCursor(0,1);
lcd.print("Humi: ");
lcd.print(humi);
lcd.print(" %");
delay(2000);
}

Error

Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\Steva Markov\Documents\Arduino\sketch_aug01b\sketch_aug01b.ino:1:17: fatal error: DHT.h: No such file or directory

#include <DHT.h>

^

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.

That means that the DHT library is not properly installed. How to install library.

When I compile it I get LOTs of errors. In general they mean that the "LiquidCrystel_I2C" and "DHT" libraries that I have installed are not the ones the sketch requires.

sketch_jul16a:5: error: 'POSITIVE' was not declared in this scope
 LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
                                                     ^
sketch_jul16a:6: error: no matching function for call to 'DHT::DHT()'
 DHT dht;
     ^
/Users/john/Documents/Arduino/sketch_jul16a/sketch_jul16a.ino:6:5: note: candidates are:
In file included from /Users/john/Documents/Arduino/sketch_jul16a/sketch_jul16a.ino:2:0:
/Users/john/Documents/Arduino/libraries/DHT_sensor_library/DHT.h:40:4: note: DHT::DHT(uint8_t, uint8_t, uint8_t)
    DHT(uint8_t pin, uint8_t type, uint8_t count=6);
    ^
/Users/john/Documents/Arduino/libraries/DHT_sensor_library/DHT.h:40:4: note:   candidate expects 3 arguments, 0 provided
/Users/john/Documents/Arduino/libraries/DHT_sensor_library/DHT.h:38:7: note: constexpr DHT::DHT(const DHT&)
 class DHT {
       ^
/Users/john/Documents/Arduino/libraries/DHT_sensor_library/DHT.h:38:7: note:   candidate expects 1 argument, 0 provided
/Users/john/Documents/Arduino/libraries/DHT_sensor_library/DHT.h:38:7: note: constexpr DHT::DHT(DHT&&)
/Users/john/Documents/Arduino/libraries/DHT_sensor_library/DHT.h:38:7: note:   candidate expects 1 argument, 0 provided
/Users/john/Documents/Arduino/sketch_jul16a/sketch_jul16a.ino: In function 'void setup()':
sketch_jul16a:9: error: 'class DHT' has no member named 'setup'
   dht.setup(DHTPin);
       ^
/Users/john/Documents/Arduino/sketch_jul16a/sketch_jul16a.ino: In function 'void loop()':
sketch_jul16a:14: error: 'class DHT' has no member named 'getTemperature'
   float temp = dht.getTemperature();
                    ^
sketch_jul16a:15: error: 'class DHT' has no member named 'getHumidity'
   float humi = dht.getHumidity();
                    ^
exit status 1
'POSITIVE' was not declared in this scope

C:\Users\Steva Markov\AppData\Local\Temp\Rar$DIa0.347\DHT11_LCD\DHT11_LCD.ino: In function 'void loop()':

DHT11_LCD:30: error: expected primary-expression before '.' token

int h = dht.readHumidity();

^

DHT11_LCD:31: error: expected primary-expression before '.' token

int t = dht.readTemperature();

^

exit status 1
expected primary-expression before '.' token

#include <dht.h> //DHT and LCD libraries
#include <LiquidCrystal_I2C.h>

#define I2C_ADDR 0x27 
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7

LiquidCrystal_I2C lcd(0x27,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

dht DHT; //Declaring the DHT as a dht type to use it later

#define DHT11_PIN 7 //Declaring where the DHT signal pin is wired

void setup(){
  Serial.begin(9600);
              lcd.begin (16,2);
            lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
            lcd.setBacklight(HIGH);
            lcd.home ();
}

void loop() {
  
  int h = dht.readHumidity();
  int t = dht.readTemperature();
  
  //convert t to Fahrenheit
  int f = (t * 9.0)/ 5.0 + 32.0;

    // set cursor to (0,0):
  lcd.setCursor(0, 0);
 
    // ADDING TEXT
  lcd.print("P1nesap IoT");
  lcd.setCursor(0,1);
  lcd.print("Weather Monitor");
  delay(5000);
  lcd.clear();
  
  //END TEXT 
  

   lcd.print("Temp: ");
     lcd.print(f);
     lcd.print("F  ");
     lcd.print(t);
     lcd.print("C");
     
  // set cursor to (16,1):
  lcd.setCursor(0,1);
  lcd.print("Humidity: ");
  lcd.print(h);
  lcd.print("%");
    delay(5000);
    //ADDING
    lcd.clear();
    
  lcd.setCursor(0,0);
  if ((f) >= 85 && (h) >= 51)  {
    lcd.print("Hot and humid...");
    lcd.setCursor(0,1);
    lcd.print("Drink water.");
  }
  else if ((f) <= 85 && (f) >= 64 && (h) <= 51) {
    lcd.print("Perfect!");
    lcd.setCursor(0,1);
    lcd.print("Warm and dry.");
  }
  
  else if ((f) <= 85 && (f) >= 64 && (h) >= 51) {
    lcd.print("Warm and moist,");
    lcd.setCursor(0,1);
    lcd.print("Sounds yummy.");
  }
  else if ((f) >= 50 && (f) <= 64  && (h) >= 51) {
    lcd.print("Cool and damp...");
    lcd.setCursor(0,1);
    lcd.print("Raincoat?");
  }
  
  else if ((f) >= 50 && (f) <= 64 && (h) <= 51) {
    lcd.print("Cool and dry.");
    lcd.setCursor(0,1);
    lcd.print("Wear a sweater.");
  }
  else if ((f) >= 33 && (f) <= 50 && (h) <= 51) {
    lcd.print("Cool and dry,");
    lcd.setCursor(0,1);
    lcd.print("On the brisk side.");
  }
  else if ((f) >= 33 && (f) <= 50 && (h) >= 51) {
    lcd.print("Raw weather...");
    lcd.setCursor(0,1);
    lcd.print("Read a book.");
  }
  
  else if ((f) >= 17 && (f) <= 33 && (h) <= 51) {
    lcd.print("Ah, winter cold");
    lcd.setCursor(0,1);
    lcd.print("Dress in layers.");
  }
  else if ((f) < 17 ) {
    lcd.print("OK, now it's");
    lcd.setCursor(0,1);
    lcd.print("REALLY cold!");
  }
 
  else {
    lcd.print("Alert: alien");
    lcd.setCursor(0,1);
    lcd.print("atmosphere!");
  }
  delay(5000);
  lcd.clear();
}

post all the code?
remember to use code tags

@PetarSRB, do not cross-post again.

C:\Users\Steva Markov\AppData\Local\Temp\Rar$DIa0.347\DHT11_LCD\DHT11_LCD.ino: In function 'void loop()':

DHT11_LCD:30: error: expected primary-expression before '.' token

int h = dht.readHumidity();

^

DHT11_LCD:31: error: expected primary-expression before '.' token

int t = dht.readTemperature();

^

exit status 1
expected primary-expression before '.' token

#include <dht.h> //DHT and LCD libraries
#include <LiquidCrystal_I2C.h>

#define I2C_ADDR 0x27 
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7

LiquidCrystal_I2C lcd(0x27,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

dht DHT; //Declaring the DHT as a dht type to use it later

#define DHT11_PIN 7 //Declaring where the DHT signal pin is wired

void setup(){
  Serial.begin(9600);
              lcd.begin (16,2);
            lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
            lcd.setBacklight(HIGH);
            lcd.home ();
}

void loop() {
  
  int h = dht.readHumidity();
  int t = dht.readTemperature();
  
  //convert t to Fahrenheit
  int f = (t * 9.0)/ 5.0 + 32.0;

    // set cursor to (0,0):
  lcd.setCursor(0, 0);
 
    // ADDING TEXT
  lcd.print("P1nesap IoT");
  lcd.setCursor(0,1);
  lcd.print("Weather Monitor");
  delay(5000);
  lcd.clear();
  
  //END TEXT 
  

   lcd.print("Temp: ");
     lcd.print(f);
     lcd.print("F  ");
     lcd.print(t);
     lcd.print("C");
     
  // set cursor to (16,1):
  lcd.setCursor(0,1);
  lcd.print("Humidity: ");
  lcd.print(h);
  lcd.print("%");
    delay(5000);
    //ADDING
    lcd.clear();
    
  lcd.setCursor(0,0);
  if ((f) >= 85 && (h) >= 51)  {
    lcd.print("Hot and humid...");
    lcd.setCursor(0,1);
    lcd.print("Drink water.");
  }
  else if ((f) <= 85 && (f) >= 64 && (h) <= 51) {
    lcd.print("Perfect!");
    lcd.setCursor(0,1);
    lcd.print("Warm and dry.");
  }
  
  else if ((f) <= 85 && (f) >= 64 && (h) >= 51) {
    lcd.print("Warm and moist,");
    lcd.setCursor(0,1);
    lcd.print("Sounds yummy.");
  }
  else if ((f) >= 50 && (f) <= 64  && (h) >= 51) {
    lcd.print("Cool and damp...");
    lcd.setCursor(0,1);
    lcd.print("Raincoat?");
  }
  
  else if ((f) >= 50 && (f) <= 64 && (h) <= 51) {
    lcd.print("Cool and dry.");
    lcd.setCursor(0,1);
    lcd.print("Wear a sweater.");
  }
  else if ((f) >= 33 && (f) <= 50 && (h) <= 51) {
    lcd.print("Cool and dry,");
    lcd.setCursor(0,1);
    lcd.print("On the brisk side.");
  }
  else if ((f) >= 33 && (f) <= 50 && (h) >= 51) {
    lcd.print("Raw weather...");
    lcd.setCursor(0,1);
    lcd.print("Read a book.");
  }
  
  else if ((f) >= 17 && (f) <= 33 && (h) <= 51) {
    lcd.print("Ah, winter cold");
    lcd.setCursor(0,1);
    lcd.print("Dress in layers.");
  }
  else if ((f) < 17 ) {
    lcd.print("OK, now it's");
    lcd.setCursor(0,1);
    lcd.print("REALLY cold!");
  }
 
  else {
    lcd.print("Alert: alien");
    lcd.setCursor(0,1);
    lcd.print("atmosphere!");
  }
  delay(5000);
  lcd.clear();
}

Case matters. Try

  int h = DHT.readHumidity();

DON'T CROSS POST!!!!!!!!!!!!!!!!!!!!
http://forum.arduino.cc/index.php?topic=561092
I HAVE REPORTED THIS THREAD TO THE MODERATORS
This is your fifth thread you've started on this. You've already been told multiple times not to cross post. People have been trying to help you. Why would you do this?

Sorry Pert this is my first time on any forum, thanks for help.

Even if you have never been on a forum before you should know that when people tell you not to do something you shouldn't do it. Especially so when these are the people you're hoping to get free help from.

Ignorance of the rules is no excuse. There is a "How to use this forum - please read." post at the top of every forum section. Clearly you didn't read it. Please do so now:
http://forum.arduino.cc/index.php?topic=148850

When I use this int h = DHT.readHumidity(); (I will read now "How to use this forum")
Error is

C:\Users\Steva Markov\AppData\Local\Temp\Rar$DIa0.347\DHT11_LCD\DHT11_LCD.ino: In function 'void loop()':

DHT11_LCD:30: error: 'class dht' has no member named 'readHumidity'

    int h = DHT.readHumidity();

                ^

DHT11_LCD:31: error: 'class dht' has no member named 'readTemperature'

  int t = DHT.readTemperature();

              ^

exit status 1
'class dht' has no member named 'readHumidity'