-
Notifications
You must be signed in to change notification settings - Fork 82
Description
Platform
ESP32
IDE / Tooling
pioarduino
What happened?
I found a strange behavior when trying to compile a project using this library.
If I include it but don’t include the header in the program, it gives a compilation error — but if I do include it, it compiles fine, even without actually using it. It was tested with different platform versions and with different LDF modes.
Stack Trace
including the header:
Compiling .pio/build/esp32dev/lib452/WebServer/Parsing.cpp.o
Compiling .pio/build/esp32dev/lib452/WebServer/WebServer.cpp.o
Linking .pio/build/esp32dev/firmware.elf
Retrieving maximum program size .pio/build/esp32dev/firmware.elf
Checking size .pio/build/esp32dev/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 6.2% (used 20328 bytes from 327680 bytes)
Flash: [== ] 22.7% (used 297765 bytes from 1310720 bytes)
Building .pio/build/esp32dev/firmware.bin
esptool.py v4.8.1.1
Creating esp32 image...
Merged 2 ELF sections
Successfully created esp32 image.
without including the header:
Processing esp32dev (platform: https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip; board: esp32doit-devkit-v1; framework: arduino)
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (51.3.6) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.0.7
- framework-arduinoespressif32-libs @ 5.1.0+sha.632e0c2a9f
- tool-esptoolpy @ 4.8.1
- tool-mklittlefs @ 3.2.0
- tool-riscv32-esp-elf-gdb @ 12.1.0+20221002
- tool-xtensa-esp-elf-gdb @ 12.1.0+20221002
- toolchain-xtensa-esp32 @ 12.2.0+20230208
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ strict
Found 42 compatible libraries
Scanning dependencies...
Dependency Graph
|-- AsyncTCP @ 3.4.9
|-- ESPAsyncWebServer @ 3.8.1
Building in release mode
Compiling .pio/build/esp32dev/src/main.cpp.o
Compiling .pio/build/esp32dev/lib452/WebServer/Parsing.cpp.o
Compiling .pio/build/esp32dev/lib452/WebServer/WebServer.cpp.o
/home/ezedg/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src/Parsing.cpp:24:10: fatal error: NetworkServer.h: No such file or directory
- Looking for NetworkServer.h dependency? Check our library registry!
- CLI > platformio lib search "header:NetworkServer.h"
- Web > https://registry.platformio.org/search?q=header:NetworkServer.h
24 | #include "NetworkServer.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
/home/ezedg/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src/WebServer.cpp:28:10: fatal error: NetworkServer.h: No such file or directory
- Looking for NetworkServer.h dependency? Check our library registry!
- CLI > platformio lib search "header:NetworkServer.h"
- Web > https://registry.platformio.org/search?q=header:NetworkServer.h
28 | #include "NetworkServer.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio/build/esp32dev/lib452/WebServer/Parsing.cpp.o] Error 1
*** [.pio/build/esp32dev/lib452/WebServer/WebServer.cpp.o] Error 1
Minimal Reproductible Example (MRE)
main.cpp (with and without the line commented)
#include <Arduino.h>
// #include <ESPAsyncWebServer.h>
void setup() {
Serial.begin(9600);
Serial.println("Hello, Arduino!");
}
void loop() {
// Your main code would go here
}
[env:esp32dev]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip
board = esp32doit-devkit-v1
framework = arduino
monitor_speed = 115200
board_build.filesystem = littlefs
; build_flags = -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE
lib_compat_mode = strict
lib_ldf_mode = chain
lib_deps =
ESP32Async/AsyncTCP
ESP32Async/ESPAsyncWebServer
I confirm that:
- I have read the documentation.
- I have searched for similar discussions.
- I have searched for similar issues.
- I have looked at the examples.
- I have upgraded to the lasted version of ESPAsyncWebServer (and AsyncTCP for ESP32).