Hieromon / AutoConnect

An Arduino library for ESP8266/ESP32 WLAN configuration at runtime with the Web interface
https://hieromon.github.io/AutoConnect/
MIT License
911 stars 190 forks source link

Using "AutoConnectCore.h" header and running into errors #601

Closed MudassirTufail closed 1 year ago

MudassirTufail commented 1 year ago

Hello I followed the instructions on "Reducing Binary Size" at https://hieromon.github.io/AutoConnect/basicusage.html and switched to using #include , but running into errors below: [no errors as I switch back to using #include ]. Could you please advise, thank you

Compiling .pio\build\esp32doit-espduino\lib1c8\AutoConnect\AutoConnectUpdate.cpp.o .pio/libdeps/esp32doit-espduino/AutoConnect/src/AutoConnectOTA.cpp:19:10: fatal error: Update.h: No such file or directory





Hieromon commented 1 year ago

This occurs when PIO Library Finder does not select the appropriate include headers; without lib_ldf_mode or no deep/deep+, PIO obtains the necessary include headers resulting from static code analysis but does not evaluate the preprocessor directives recursively. Therefore, source files based on all the include headers detected by PIO's pre-build scan are targets for compilation. This is why you got an error trying to compile AutoConnectAux.cpp even though your build target is .

To fix, specify lib_ldf_mode = deep or deep+ with pio.ini. Since this instruction way is missing from the description of the AutoConnect documentation, I will add it.

MudassirTufail commented 1 year ago

Thank You I used lib_ldf_mode = deep+ in platform.ini file and that worked.