Error compiling EthernetWebServer

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.

You need to use a library designed for the ESP32.