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

Follow this link: How to Set Up the DHT11 Humidity Sensor on an Arduino

Then download the library with a click on the DHTLib text you can see in the picture below:

Add the .zip as library in the Arduino IDE

The go to Sketch -> Include Library
Click on your library

Now you should see something like this:

#include <dht.h>                //This is the correct include of the DHTLib from www.circuitbasics.com

Here is the complete code and it compiles:

//This compiles for Arduino UNO

#include <Wire.h>
//#include <DHT.h>                    //This is what you had included in your first post
#include <dht.h>                       //This is the correct include of the DHTLib from www.circuitbasics.com
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

//DHT dht;                            //This is what you had included in your first post
dht DHT;                              //This is correct for the "<dht.h>" include from above

#define DHT11_PIN 7

void setup() {
  lcd.begin(16, 2);
}

void loop()
{
  int chk = DHT.read11(DHT11_PIN); 
  lcd.setCursor(0, 0);
  lcd.print("Temp: ");
  lcd.print(DHT.temperature);
  lcd.print((char)223);
  lcd.print("C");
  lcd.setCursor(0, 1);
  lcd.print("Humidity: ");
  lcd.print(DHT.humidity);
  lcd.print("%");
  delay(1000);
}

Thank you for that.

I now realise what has happened to make me say it wouldn't compile.

I saw the DHTLib file on the said webpage, but didn't download it as I already had a DHTLib library folder. The problem was that in the DHTLib folder the actual library files were DHTLib.h and DHTLibPort.h. And there was the confusion I had, and that is one cause or reason why it would not compile.

After downloading the DHTLib.zip file and using that on my desktop for the sketch, it still would not compile , so I had to remove the existing DHTLib folder before it did compile.

Thanks