ayushsharma82 / ElegantOTA

OTA updates made slick and simple for everyone!
https://elegantota.pro
GNU Affero General Public License v3.0
643 stars 119 forks source link

Compilation error: cannot convert 'AsyncWebServer*' to 'WebServer*' #224

Closed glenlau228 closed 1 month ago

glenlau228 commented 1 month ago
In file included from D:\Arduino\Arduino15\packages\esp32\hardware\esp32\3.1.0-RC1\libraries\WebServer\src/HTTP_Method.h:4, from D:\Arduino\Arduino15\packages\esp32\hardware\esp32\3.1.0-RC1\libraries\WebServer\src/WebServer.h:30, from d:\Arduino\libraries\ElegantOTA\src/ElegantOTA.h:73, from D:\Arduino\WiFi_Web_Server\WiFi_Web_Server.ino:21: D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:95:6: error: 'HTTP_DELETE' conflicts with a previous declaration 95 XX(0, DELETE, DELETE) \ ^ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:138:45: note: in definition of macro 'XX' 138 #define XX(num, name, string) HTTP_##name = num, ^~~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP' 139 HTTP_METHOD_MAP(XX) ^~~~~~~ In file included from D:\Arduino\WiFi_Web_Server\WiFi_Web_Server.ino:16: d:\Arduino\libraries\ESP_Async_WebServer\src/ESPAsyncWebServer.h:76:5: note: previous declaration 'WebRequestMethod HTTP_DELETE' 76 HTTP_DELETE = 0b00000100, ^~~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:96:6: error: 'HTTP_GET' conflicts with a previous declaration 96 XX(1, GET, GET) \ ^ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:138:45: note: in definition of macro 'XX' 138 #define XX(num, name, string) HTTP_##name = num, ^~~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP' 139 HTTP_METHOD_MAP(XX) ^~~~~~~ d:\Arduino\libraries\ESP_Async_WebServer\src/ESPAsyncWebServer.h:74:5: note: previous declaration 'WebRequestMethod HTTP_GET' 74 HTTP_GET = 0b00000001, ^~~~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:97:6: error: 'HTTP_HEAD' conflicts with a previous declaration 97 XX(2, HEAD, HEAD) \ ^ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:138:45: note: in definition of macro 'XX' 138 #define XX(num, name, string) HTTP_##name = num, ^~~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP' 139 HTTP_METHOD_MAP(XX) ^~~~~~~ d:\Arduino\libraries\ESP_Async_WebServer\src/ESPAsyncWebServer.h:79:5: note: previous declaration 'WebRequestMethod HTTP_HEAD' 79 HTTP_HEAD = 0b00100000, ^~~~~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:98:6: error: 'HTTP_POST' conflicts with a previous declaration 98 XX(3, POST, POST) \ ^ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:138:45: note: in definition of macro 'XX' 138 #define XX(num, name, string) HTTP_##name = num, ^~~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP' 139 HTTP_METHOD_MAP(XX) ^~~~~~~ d:\Arduino\libraries\ESP_Async_WebServer\src/ESPAsyncWebServer.h:75:5: note: previous declaration 'WebRequestMethod HTTP_POST' 75 HTTP_POST = 0b00000010, ^~~~~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:99:6: error: 'HTTP_PUT' conflicts with a previous declaration 99 XX(4, PUT, PUT) \ ^ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:138:45: note: in definition of macro 'XX' 138 #define XX(num, name, string) HTTP_##name = num, ^~~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP' 139 HTTP_METHOD_MAP(XX) ^~~~~~~ d:\Arduino\libraries\ESP_Async_WebServer\src/ESPAsyncWebServer.h:77:5: note: previous declaration 'WebRequestMethod HTTP_PUT' 77 HTTP_PUT = 0b00001000, ^~~~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:102:6: error: 'HTTP_OPTIONS' conflicts with a previous declaration 102 XX(6, OPTIONS, OPTIONS) \ ^ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:138:45: note: in definition of macro 'XX' 138 #define XX(num, name, string) HTTP_##name = num, ^~~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP' 139 HTTP_METHOD_MAP(XX) ^~~~~~~ d:\Arduino\libraries\ESP_Async_WebServer\src/ESPAsyncWebServer.h:80:5: note: previous declaration 'WebRequestMethod HTTP_OPTIONS' 80 HTTP_OPTIONS = 0b01000000, ^~~~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:128:6: error: 'HTTP_PATCH' conflicts with a previous declaration 128 XX(28, PATCH, PATCH) \ ^~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:138:45: note: in definition of macro 'XX' 138 #define XX(num, name, string) HTTP_##name = num, ^~~ D:\Arduino\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.3-466a392a\esp32/include/http_parser/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP' 139 HTTP_METHOD_MAP(XX) ^~~~~~~ d:\Arduino\libraries\ESP_Async_WebServer\src/ESPAsyncWebServer.h:78:5: note: previous declaration 'WebRequestMethod HTTP_PATCH' 78 HTTP_PATCH = 0b00010000, ^~~~~~ D:\Arduino\WiFi_Web_Server\WiFi_Web_Server.ino: In function 'void setup()': D:\Arduino\WiFi_Web_Server\WiFi_Web_Server.ino:147:20: error: cannot convert 'AsyncWebServer' to 'WebServer' 147 ElegantOTA.begin(&server); // Start ElegantOTA ^~~
AsyncWebServer*

d:\Arduino\libraries\ElegantOTA\src/ElegantOTA.h:107:38: note: initializing argument 1 of 'void ElegantOTAClass::begin(WebServer, const char, const char)' 107 | void begin(ELEGANTOTA_WEBSERVER server, const char username = "", const char password = ""); | ^

exit status 1

Compilation error: cannot convert 'AsyncWebServer' to 'WebServer'

glenlau228 commented 1 month ago

下图为解决办法 图片

glenlau228 commented 1 month ago

RTFM