-->
Page 1 of 1

Compilation error with ESP8266WiFi.h library

PostPosted: Wed Nov 18, 2020 11:08 pm
by ym58
Using a ESP8266 development board like this :
Imageon the latest IDE platform (1.8.13) with the latest board manager (2.7.4), I obtain a compilation error from sketches that used to work quite well on earlier versions of IDE and board mgr.

The compilation error is :
In file included from C:\Users\..........\ARDUINO-ESP8266\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFi.h:39:0,
from C:\Users\..........\ARDUINO-ESP8266\Arduino\tmp11\tmp11.ino:3:
C:\Users\...........\ARDUINO-ESP8266\Arduino\libraries\ESP8266WiFi\src/WiFiClient.h:89:7: error: 'int WiFiClient::availableForWrite()' marked override, but does not override
int availableForWrite() override;
......^


The (simple) test code in the tmp11.ino sketch (please note that other more elaborated sketches where ESP8266WiFi.h is involved produce the same issue) is :

Code: Select all#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
const char* ssid = "MySSID";
const char* password = "12345678";
ESP8266WebServer server(80);
//
void handleRoot() {
  server.send(200, "text/plain", "hello from esp8266!");
}
void setup(void){
  Serial.begin(9600);
  WiFi.disconnect(true);
  delay(1000);
 
  WiFi.mode(WIFI_AP);         
  WiFi.softAP(ssid, password); 

  IPAddress myIP = WiFi.softAPIP();
  Serial.print("HotSpt IP:");
  Serial.println(myIP);
 
  server.on("/", handleRoot);     

  server.begin();                 
  Serial.println("HTTP server started");
}

void loop(void){
  server.handleClient();          //Handle client requests
}

Any idea ?
Thx

Re: Compilation error with ESP8266WiFi.h library

PostPosted: Fri Nov 20, 2020 2:09 am
by JurajA
don't install the library separately. It is bundled with the esp8266 boards package in the right version

Re: Compilation error with ESP8266WiFi.h library

PostPosted: Fri Nov 20, 2020 4:05 am
by ym58
Got it.
I just removed the extra redundant libraries and kept only the 'bundled' ones and it now compiles right !
Thanks for the help.