Hello,
i am using the EthernetWebServer library to connect my ESP32S3 to the net using W5500.
When i compile my code, which is written using Arduino IDE, i get the following error message:
h:\Documents\Arduino\libraries\EthernetWebServer-2.4.1\src/EthernetWebServer.hpp:576:25: error: cannot declare field 'EthernetWebServer::_server' to be of abstract type 'EthernetServer'
576 | EthernetServer _server;
| ^~~~~~~
h:\Documents\Arduino\libraries\Ethernet_Generic-2.8.1\src/Ethernet_Generic.hpp:532:7: note: because the following virtual functions are pure within 'EthernetServer':
532 | class EthernetServer : public Server
I have change the virtual function in Server.h from:
virtual void begin(uint16_t port=0) =0;
to:
void begin() {};
No success.
I searched in the net for this issue but almost all what i got are recommendations to change the Server.h (what i already did).
Is there any other reason for this or other solution?
If you look at the github site for the library, you will notice it is NOT for the ESP8266/ESP32.
This is simple yet complete WebServer library for AVR, AVR Dx, Portenta_H7, Teensy, SAM DUE, SAMD21/SAMD51, nRF52, STM32, RP2040-based, etc. boards running Ethernet shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32.
Thank you for your reply.
I already had managed to use this library and has established a connection successfully.
After that i have worked on Modbus and successfully made it work.
Now i want to modify my code but for some unknown reason the old unchanged code does not work now.
The only chanfe i made was to update the libraries through arduino ide.
And the solution is:
changing the Server.h file in the updated library:
C:\Users\username\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha3\cores\esp32
from
virtual void begin(uint16_t port=0) =0;
to:
void begin() {};
Note that Server.h folder my vary from one to another.
For other may be:
C:\Program Files (x86)\Arduino\hardware.......\esp32