Error compiling for board WeMos D1 R1

I have WEMOS D1 board based on ESP8266 and I want to blink led over the wifi

I haven’t written this code. I did the copy & paste to check result

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>

// Fill in your WiFi router SSID and password
const char* ssid = "JAlTYRt";
const char* password = "hgjg321";
MDNSResponder mdns;

ESP8266WebServer server(80);

const char INDEX_HTML[] =
"<!DOCTYPE HTML>"
"<html>"
"<head>"
"<meta name = \"viewport\" content = \"width = device-width, initial-scale = 1.0, maximum-scale = 1.0, user-scalable=0\">"
"<title>ESP8266 Web Form Demo</title>"
"<style>"
"\"body { background-color: #808080; font-family: Arial, Helvetica, Sans-Serif; Color: #000000; }\""
"</style>"
"</head>"
"<body>"
"<h1>ESP8266 Web Form Demo</h1>"
"<FORM action=\"/\" method=\"post\">"
"<P>"
"LED
"
"<INPUT type=\"radio\" name=\"LED\" value=\"0\">On
"
"<INPUT type=\"radio\" name=\"LED\" value=\"1\">Off
"
"<INPUT type=\"submit\" value=\"Send\"> <INPUT type=\"reset\">"
"</P>"
"</FORM>"
"</body>"
"</html>";

// GPIO#0 is for Adafruit ESP8266 HUZZAH board. Your board LED might be on 13.
const int LEDPIN = D0;

void handleRoot()
{
 if (server.hasArg("LED")) {
   handleSubmit();
 }
 else {
   server.send(200, "text/html", INDEX_HTML);
 }
}

void returnFail(String msg)
{
 server.sendHeader("Connection", "close");
 server.sendHeader("Access-Control-Allow-Origin", "*");
 server.send(500, "text/plain", msg + "\r\n");
}

void handleSubmit()
{
 String LEDvalue;

 if (!server.hasArg("LED")) return returnFail("BAD ARGS");
 LEDvalue = server.arg("LED");
 if (LEDvalue == "1") {
   writeLED(true);

Following are errors

Arduino: 1.8.5 (Windows 10), Board: “WeMos D1 R1, 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 921600”

In file included from e:\4. internet of things\2. esp8266\arduino-1.8.5-windows\arduino-1.8.5\portable\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\algorithm:60:0,

from E:\4. Internet of Things\2. ESP8266\arduino-1.8.5-windows\arduino-1.8.5\portable\packages\esp8266\hardware\esp8266\2.4.2\cores\esp8266/Arduino.h:255,

from sketch\sketch_oct08.ino.cpp:1:

e:\4. internet of things\2. esp8266\arduino-1.8.5-windows\arduino-1.8.5\portable\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\utility:68:28: fatal error: bits/c++config.h: No such file or directory

#include <bits/c++config.h>

^

compilation terminated.

exit status 1
Error compiling for board WeMos D1 R1.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

I get another error message because the pasted code isn't complete. The code block isn't terminated so the error is correct.

Okay I am trying with new code

#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
 
const char* ssid = "ffgg fj f";
const char* password = "ggg";
 
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();
}

I am getting following error

Arduino: 1.8.5 (Windows 10), Board: “WeMos D1 R1, 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 921600”

GetFileAttributesEx C:\Users\vj\AppData\Local\Temp\arduino_cache_191064: The system cannot find the file specified.

Error compiling for board WeMos D1 R1.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

Rehan11:
Okay I am trying with new code

I am getting following error

Compiles fine for me

Sketch uses 286640 bytes (27%) of program storage space. Maximum is 1044464 bytes.
Global variables use 29860 bytes (36%) of dynamic memory, leaving 52060 bytes for local variables. Maximum is 81920 bytes.

If you remove the first line it compiles. WiFiClient.h might be included from any other library which might be platform specific.

I think I am doing mistake in the selection of board

I have this board D1 wifi uno esp-12e based esp8266 module Sale - Banggood.com

tools -> WeMos D1 R1

pylon:
If you remove the first line it compiles. WiFiClient.h might be included from any other library which might be platform specific.

What version of the ESP8266 core are you using as WiFiClient.h is part of the 2.4.2 core (\hardware\esp8266\2.4.2\libraries\ESP8266WiFi\src)