While compiling my rather simple project I get an error that I'm unable to resolve. The included libraries are:
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
#include <ESPmDNS.h>
And the error that HTTP_GET was not declared in this scope concerns the following line :
message += (server.method() == HTTP_GET) ? "GET" : "POST";
I'm using an ESP32 module produced by AZDelivery, the board is selected and other simple projects (like blinking the internal LED) word like a charm.
Any ideas how to solve this would be appreciated
EDIT: below is the full error message as thrown in Arduino IDE (on macos)
Users/yannickgery/Documents/Arduino/controlservo/controlservo.ino: In function 'void handleNotFound()':
controlservo:156:34: error: 'HTTP_GET' was not declared in this scope
message += (server.method() == HTTP_GET) ? "GET" : "POST";
^
/Users/yannickgery/Documents/Arduino/controlservo/controlservo.ino: In function 'void setup()':
controlservo:206:23: error: 'HTTP_GET' was not declared in this scope
server.on("/motor", HTTP_GET, motorControl);
^
Multiple libraries were found for "WiFi.h"
Used: /Users/yannickgery/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/WiFi
Not used: /Applications/Arduino.app/Contents/Java/libraries/WiFi
exit status 1
'HTTP_GET' was not declared in this scope
question from:
https://stackoverflow.com/questions/65919148/http-get-was-not-declared-in-this-scope 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…