Skip to content

Webserver library not compatible with Update library - Won't Compile #4884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TheRealDJ opened this issue Mar 2, 2021 · 0 comments · Fixed by #4900
Closed

Webserver library not compatible with Update library - Won't Compile #4884

TheRealDJ opened this issue Mar 2, 2021 · 0 comments · Fixed by #4900

Comments

@TheRealDJ
Copy link
Contributor

Hardware:

Board:					ESP32 Dev Module
Core Installation version:		1.0.5
IDE name:				Arduino IDE
Flash Frequency:			40Mhz
PSRAM enabled:				yes
Upload Speed:				115200
Computer OS:				Ubuntu

Description:

I can not compile source when attempting to include both WebServer.h and HttpsOTAUpdate.h. There are overlapping (and different) definitions for

  • HTTP_GET
  • HTTP_POST
  • HTTP_DELETE
  • HTTP_PUT
  • HTTP_PATCH
  • HTTP_HEAD
  • HTTP_OPTIONS
  • HTTP_ANY

I was able to work around this by changing all above HTTP_XXX definitions/references in the Webserver library with WEBSERVER_HTTP_XXX.

Sketch:

//Change the code below by your sketch
#include <WebServer.h>
#include <HttpsOTAUpdate.h>

void setup() {
}

void loop() {
}

Debug Messages:

Below is compiler output. I removed part of the path and some lines for readability.

.../1.0.5/tools/sdk/include/nghttp/http_parser.h:95:6: error: redeclaration of 'HTTP_DELETE'
.../1.0.5/libraries/WebServer/src/HTTP_Method.h:7:3: note: previous declaration 'HTTPMethod HTTP_DELETE'
.../1.0.5/tools/sdk/include/nghttp/http_parser.h:96:6: error: redeclaration of 'HTTP_GET'
.../1.0.5/libraries/WebServer/src/HTTP_Method.h:5:3: note: previous declaration 'HTTPMethod HTTP_GET'
.../1.0.5/tools/sdk/include/nghttp/http_parser.h:97:6: error: redeclaration of 'HTTP_HEAD'
.../1.0.5/libraries/WebServer/src/HTTP_Method.h:10:3: note: previous declaration 'HTTPMethod HTTP_HEAD'
.../1.0.5/tools/sdk/include/nghttp/http_parser.h:98:6: error: redeclaration of 'HTTP_POST'
.../1.0.5/libraries/WebServer/src/HTTP_Method.h:6:3: note: previous declaration 'HTTPMethod HTTP_POST'
.../1.0.5/tools/sdk/include/nghttp/http_parser.h:99:6: error: redeclaration of 'HTTP_PUT'
.../1.0.5/libraries/WebServer/src/HTTP_Method.h:8:3: note: previous declaration 'HTTPMethod HTTP_PUT'
.../1.0.5/tools/sdk/include/nghttp/http_parser.h:102:6: error: redeclaration of 'HTTP_OPTIONS'
.../1.0.5/libraries/WebServer/src/HTTP_Method.h:11:3: note: previous declaration 'HTTPMethod HTTP_OPTIONS'
.../1.0.5/tools/sdk/include/nghttp/http_parser.h:128:6: error: redeclaration of 'HTTP_PATCH'
.../1.0.5/libraries/WebServer/src/HTTP_Method.h:9:3: note: previous declaration 'HTTPMethod HTTP_PATCH'
me-no-dev added a commit that referenced this issue Mar 5, 2021
Fixes: #4884

* Use HTTP method table from ESP-IDF's nghttp
* Parse methods using IDF's HTTP method list
* Make example's loops to allow the CPU to switch tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant