ESP8266 12E Arduino IDE Compiling Error

I’ve been trying to compile some code but it doesn’t compile because of the command, “WiFiClient client;” It says, “cannot declare variable ‘client’ to be of abstract type 'WiFiClient.” I couldn’t find anything online about this type of error. However, I’ve seen many people use this line of code in their programs and they work. Does anyone know what going on? The overall project that this code is being used for is to connect a DHT22 and LDR sensor to thingspeak in order to graph the sensors data.

//library DHT22
#include <DHT.h>

//library esp
#include <ESP8266WiFi.h>
#include <WiFiClient.h>


String apiKey = "";                                     //fill in the api key from thingspeak
const char* ssid = "";                                  //fill in your wifi name
const char* password = "";                              //fill in your wifi password

const char* server = "api.thingspeak.com";
#define DHTPIN 2 // what pin it's connected to

DHT dht(DHTPIN, DHT22,15);
WiFiClient client;

int sensorPin = A0;    // input for LDR sensor
int enable1 = 15;      // enable reading LDR


int sensorValue1 = 0;  // variable to store the value coming from sensor LDR


//--------------------------setup-------------------------
void setup() {

// declare the enable and ledPin as an OUTPUT:
pinMode(enable1, OUTPUT);
pinMode(enable2, OUTPUT);

  
Serial.begin(115200);
delay(10);

dht.begin();

WiFi.begin(ssid, password);

Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
Serial.print("..........");
Serial.println();
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);

}
Serial.println("WiFi connected");
Serial.println();

}


void loop() {
//--------------------------DHT22/DHT11-------------------------

float h = dht.readHumidity();
float t = dht.readTemperature();

if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}


Serial.print("Temperature:      ");
Serial.print(t);
Serial.print(" Degrees Fahrenheit");
Serial.println(1);

Serial.print("Humidity:         ");
Serial.print(h);
Serial.print("%");
Serial.println();

//--------------------------Temperature, Humidity, and Dew Point------------------------

double gamma = log(h/100) + ((17.62*t) / (243.5+t));
double dp = 243.5*gamma / (17.62-gamma);

Serial.print("Dew point:        ");
Serial.print(dp);
Serial.print(" degrees Celcius ");
Serial.println();

//--------------------------LDR-------------------------

  digitalWrite(enable1, HIGH); 
sensorValue1 = analogRead(sensorPin);
sensorValue1 = constrain(sensorValue1, 300, 850); 
sensorValue1 = map(sensorValue1, 300, 850, 0, 1023); 
Serial.print("Light intensity:  ");
Serial.println(sensorValue1);
digitalWrite(enable1, LOW);
delay(100);

//--------------------------thingspeak-------------------------

if (client.connect(server,80)) { // "184.106.153.149" or api.thingspeak.com
String postStr = apiKey;
postStr +="&field1=";
postStr += String(t);
postStr +="&field2=";
postStr += String(h);
postStr +="&field3=";
postStr += String(dp);
postStr +="&field4=";
postStr += String(sensorValue1);
postStr += "\r\n\r\n\r\n\r\n";

client.print("POST /update HTTP/1.1\n");
client.print("Host: api.thingspeak.com\n");
client.print("Connection: close\n");
client.print("X-THINGSPEAKAPIKEY: "+apiKey+"\n");
client.print("Content-Type: application/x-www-form-urlencoded\n");
client.print("Content-Length: ");
client.print(postStr.length());
client.print("\n\n\n\n");
client.print(postStr);



}
client.stop();


// thingspeak needs minimum 15 sec delay between updates
delay(20000);
}