ESP8266 Web Server LED Control Wemos D1

hello

I was testing web server weather the server is properly but my server is not working

 #include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
 
const char* ssid = "......";
const char* password = "......";
 
ESP8266WebServer server(80);
 
const int led = 13;
 
void handleRoot() {
  digitalWrite(led, 1);
  server.send(200, "text/plain", "Hello from esp8266!");
  digitalWrite(led, 0);
}
 
void handleNotFound(){
  digitalWrite(led, 1);
  String message = "File Not Found\n\n";
  message += "URI: ";
  message += server.uri();
  message += "\nMethod: ";
  message += (server.method() == HTTP_GET)?"GET":"POST";
  message += "\nArguments: ";
  message += server.args();
  message += "\n";
  for (uint8_t i=0; i<server.args(); i++){
    message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
  }
  server.send(404, "text/plain", message);
  digitalWrite(led, 0);
}
 
void setup(void){
  pinMode(led, OUTPUT);
  digitalWrite(led, 0);
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  Serial.println("");
 
  // Wait for connection
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.print("Connected to ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
 
  if (MDNS.begin("esp8266")) {
    Serial.println("MDNS responder started");
  }
 
  server.on("/", handleRoot);
 
  server.on("/inline", [](){
    server.send(200, "text/plain", "this works as well");
  });
 
  server.onNotFound(handleNotFound);
 
  server.begin();
  Serial.println("HTTP server started");
}
 
void loop(void){
  server.handleClient();
}

program show following error

Arduino: 1.8.5 (Windows 10), Board: "WeMos D1 mini, 80 MHz, Serial, 921600, 4M (3M SPIFFS)"

In file included from C:\Users\Embedded\Documents\Arduino\sketch_dec20b\sketch_dec20b.ino:2:0:

C:\Users\Embedded\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:143:15: error: field '_server' has incomplete type

WiFiServer _server;

^

Multiple libraries were found for "WiFiClient.h"
Used: C:\Users\Embedded\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WiFi
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
Error compiling for board WeMos D1 mini.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Please help me to fix the issues

It compiles fine for me using the latest stable release (2.3.0) of the ESP8266 core for Arduino. I notice you're using the very outdated 2.0.0 version. This is almost certainly the cause of your problem. Are you using the old version because you need the "promiscuous mode" or whatever features were removed from later package versions?

pert:
It compiles fine for me using the latest stable release (2.3.0) of the ESP8266 core for Arduino. I notice you're using the very outdated 2.0.0 version. This is almost certainly the cause of your problem. Are you using the old version because you need the "promiscuous mode" or whatever features were removed from later package versions?

I am new for Arduino IDE so I have to download current version of ESP8266 library for Arduino from GitHub

I did google search but I couldn't find this version. Can you tell me link where I can download current version of ESP8266 library

instructions

Juraj:
instructions

I have tested 2.3.0 and 2.4.0 version.

file has been successful compiled but when I see on monitor window its show dotted line

Look at attached file How to fix problem?

That usually means you did not put the correct SSID and password in the program so it is stuck in a loop printing periods, trying to connect to an access point.