cotestatnt / async-esp-fs-webserver

ESP32/ESP8266 WebServer, WiFi manager and ACE web editor Arduino library. Based on ESPAsyncWebServer
Apache License 2.0
44 stars 12 forks source link

v1.0.3 fails to compile on Arduino #10

Closed rob040 closed 8 months ago

rob040 commented 9 months ago

For some reason, Arduino IDE 1.8.x and 2.2 are configured to compile with treat warnings as errors, because a simple warning in your library stops compilation with error:

e:\develop\Arduino\libraries\AsyncEspFsWebserver\src\AsyncFsWebServer.cpp: In member function 'void AsyncFsWebServer::handleUpload(AsyncWebServerRequest*, String, size_t, uint8_t*, size_t, bool)':
e:\develop\Arduino\libraries\AsyncEspFsWebserver\src\AsyncFsWebServer.cpp:457:20: error: unused variable 'i' [-Werror=unused-variable]
         static int i = 0;
                    ^
e:\develop\Arduino\libraries\AsyncEspFsWebserver\src\AsyncFsWebServer.cpp: At global scope:
e:\develop\Arduino\libraries\AsyncEspFsWebserver\src\AsyncFsWebServer.cpp:457:20: error: 'i' defined but not used [-Werror=unused-variable]
cc1plus.exe: some warnings being treated as errors
Multiple libraries were found for "WiFiUdp.h"
  Used: C:\Users\Gebruiker\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\WiFi
  Not used: E:\develop\Arduino\libraries\WiFi101

Solution is to simply remove the affected line.

cotestatnt commented 9 months ago

Yes, I've seen. This is a typo that will be eliminated in the next release.

rob040 commented 9 months ago

Another issue with Arduino: when installing your library, it wants to install latest ArduinoJson. This is version 7.0.0, which is incompatible with previous version (6.21.4). Better to change that dependency in your library properties.

cotestatnt commented 9 months ago

The ArduinoJson it's as dependency, but with no specific version. It's the Arduino IDE which download automatically the latest without any kind of prompt.

Anyway, AsyncFsWebServer library works also with latest ArduinoJson despite the presence of some "depracated" warnings.

I don't want to force a specific version of ArduinoJson tied to AsyncFsWebServer. I'm planning to update the library for the new ArduinoJson APIs, but I think it's still too early. I know it's annoying, but at least this warnings are not treated as error.

rob040 commented 8 months ago

Another cause, that more user might experience, is that Arduino IDE v2 comes by default with a.o. ESP8266 support, and it apprears that the old method of adding board manager URL's has become obsolete However, that ESP8266 package is limited to version 3.0.1, causing some compilation errors. There is currently a stable release of version 3.1.2. To get this, add following URL to your Arduino IDE preference menu board manager URLs: https://arduino.esp8266.com/stable/package_esp8266com_index.json

Lets close this issue.