[GH-ISSUE #126] Error with include order in docs #95

Closed
opened 2026-02-28 01:23:23 +03:00 by kerem · 10 comments
Owner

Originally created by @SeanBannister on GitHub (Mar 15, 2016).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/126

In README.md it lists the order of the includes as:

#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>

I had to change this to:

#include <DNSServer.h>
#include <WiFiManager.h>
#include <ESP8266WebServer.h>

To avoid the following error:
error: 'WiFiClient' does not name a type

Originally created by @SeanBannister on GitHub (Mar 15, 2016). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/126 In README.md it lists the order of the includes as: ``` #include <DNSServer.h> #include <ESP8266WebServer.h> #include <WiFiManager.h> ``` I had to change this to: ``` #include <DNSServer.h> #include <WiFiManager.h> #include <ESP8266WebServer.h> ``` To avoid the following error: error: 'WiFiClient' does not name a type
kerem closed this issue 2026-02-28 01:23:23 +03:00
Author
Owner

@tzapu commented on GitHub (Mar 15, 2016):

this is how i have it in all my sketches

#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>        //https://github.com/tzapu/WiFiManager

not working for you ?

<!-- gh-comment-id:196845201 --> @tzapu commented on GitHub (Mar 15, 2016): this is how i have it in all my sketches ``` #include <DNSServer.h> #include <ESP8266WebServer.h> #include <WiFiManager.h> //https://github.com/tzapu/WiFiManager ``` not working for you ?
Author
Owner

@SeanBannister commented on GitHub (Mar 15, 2016):

As soon as I change it to that I get the following errors (but by switching them it works fine):

In file included from C:\Users\Sean\AppData\Local\Temp\arduino_15fccb0d51e8edc29ac5d81953b4c711\sketch_mar16a.ino:2:0:

C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:3: error: 'WiFiClient' does not name a type

   WiFiClient client() { return _currentClient; }

   ^

C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:127:22: error: 'WiFiClient' has not been declared

   bool _parseRequest(WiFiClient& client);

                      ^

C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:130:19: error: 'WiFiClient' has not been declared

   bool _parseForm(WiFiClient& client, String boundary, uint32_t len);

                   ^

C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:133:27: error: 'WiFiClient' has not been declared

   uint8_t _uploadReadByte(WiFiClient& client);

                           ^

C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:143:3: error: 'WiFiServer' does not name a type

   WiFiServer  _server;

   ^

C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:145:3: error: 'WiFiClient' does not name a type

   WiFiClient  _currentClient;

   ^

C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h: In member function 'size_t ESP8266WebServer::streamFile(T&, const String&)':

C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:121:10: error: '_currentClient' was not declared in this scope

   return _currentClient.write(file, HTTP_DOWNLOAD_UNIT_SIZE);

          ^

exit status 1
Error compiling.
<!-- gh-comment-id:196846330 --> @SeanBannister commented on GitHub (Mar 15, 2016): As soon as I change it to that I get the following errors (but by switching them it works fine): ``` In file included from C:\Users\Sean\AppData\Local\Temp\arduino_15fccb0d51e8edc29ac5d81953b4c711\sketch_mar16a.ino:2:0: C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:80:3: error: 'WiFiClient' does not name a type WiFiClient client() { return _currentClient; } ^ C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:127:22: error: 'WiFiClient' has not been declared bool _parseRequest(WiFiClient& client); ^ C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:130:19: error: 'WiFiClient' has not been declared bool _parseForm(WiFiClient& client, String boundary, uint32_t len); ^ C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:133:27: error: 'WiFiClient' has not been declared uint8_t _uploadReadByte(WiFiClient& client); ^ C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:143:3: error: 'WiFiServer' does not name a type WiFiServer _server; ^ C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:145:3: error: 'WiFiClient' does not name a type WiFiClient _currentClient; ^ C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h: In member function 'size_t ESP8266WebServer::streamFile(T&, const String&)': C:\Users\Sean\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:121:10: error: '_currentClient' was not declared in this scope return _currentClient.write(file, HTTP_DOWNLOAD_UNIT_SIZE); ^ exit status 1 Error compiling. ```
Author
Owner

@tzapu commented on GitHub (Mar 15, 2016):

what arduino ide are you using?

<!-- gh-comment-id:196850599 --> @tzapu commented on GitHub (Mar 15, 2016): what arduino ide are you using?
Author
Owner

@SeanBannister commented on GitHub (Mar 15, 2016):

I was running Arduino IDE 1.6.7 so I upgraded to 1.6.8 but I'm still experiencing the same issue.

ESP8266 core for Arduino - 2.1.0
WifiManager - 0.10
Windows 8.1 Pro

<!-- gh-comment-id:196884747 --> @SeanBannister commented on GitHub (Mar 15, 2016): I was running Arduino IDE 1.6.7 so I upgraded to 1.6.8 but I'm still experiencing the same issue. ESP8266 core for Arduino - 2.1.0 WifiManager - 0.10 Windows 8.1 Pro
Author
Owner

@tzapu commented on GitHub (Mar 15, 2016):

hi, do you include ESP8266WiFi.h after those 3 includes when it errors?

<!-- gh-comment-id:196905416 --> @tzapu commented on GitHub (Mar 15, 2016): hi, do you include ESP8266WiFi.h after those 3 includes when it errors?
Author
Owner

@SeanBannister commented on GitHub (Mar 15, 2016):

No, but here's the simplest example that causes the error:

#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>

void setup() {
  WiFiManager wifiManager; 
  wifiManager.autoConnect("test", "12345678");
}
<!-- gh-comment-id:196915896 --> @SeanBannister commented on GitHub (Mar 15, 2016): No, but here's the simplest example that causes the error: ``` #include <DNSServer.h> #include <ESP8266WebServer.h> #include <WiFiManager.h> void setup() { WiFiManager wifiManager; wifiManager.autoConnect("test", "12345678"); } ```
Author
Owner

@tzapu commented on GitHub (Mar 15, 2016):

try adding this on top of all those

#include <ESP8266WiFi.h>
<!-- gh-comment-id:196928318 --> @tzapu commented on GitHub (Mar 15, 2016): try adding this on top of all those ``` #include <ESP8266WiFi.h> ```
Author
Owner

@SeanBannister commented on GitHub (Mar 15, 2016):

That works :) thanks for your help.

Maybe this could be added to the readme.md?

<!-- gh-comment-id:196931950 --> @SeanBannister commented on GitHub (Mar 15, 2016): That works :) thanks for your help. Maybe this could be added to the readme.md?
Author
Owner

@tzapu commented on GitHub (Mar 15, 2016):

ok, thanks
i should probably add it then if it s not clear

cheers

<!-- gh-comment-id:196936435 --> @tzapu commented on GitHub (Mar 15, 2016): ok, thanks i should probably add it then if it s not clear cheers
Author
Owner

@tzapu commented on GitHub (Mar 16, 2016):

i ve added this now, thanks

<!-- gh-comment-id:197527236 --> @tzapu commented on GitHub (Mar 16, 2016): i ve added this now, thanks
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#95
No description provided.