khoih-prog / ESP_WiFiManager

This is an ESP32 / ESP8266 WiFi Connection Manager with fallback web configuration portal. Use this library for configuring ESP32 (including ESP32-S2 and ESP32-C3), ESP8266 modules' WiFi, etc. Credentials at runtime. You can also specify static DNS servers, personalized HostName, fixed or random AP WiFi channel. With examples supporting ArduinoJson
MIT License
371 stars 97 forks source link

link to platformio.ini file is broke #24

Closed uliatgithub closed 4 years ago

uliatgithub commented 4 years ago

In order to run the WifiManager in Platformio various libraries need to be included. In my PIO installation DNSServer functions/methods are not found when the compiled parts are going to be linked together.
Building in release mode Linking .pio\build\pico32\firmware.elf .pio\build\pico32\src\main.cpp.o:(.literal._ZN15ESP_WiFiManager17setupConfigPortalEv+0x64): undefined reference toDNSServer::DNSServer()' .pio\build\pico32\src\main.cpp.o:(.literal._ZN15ESP_WiFiManager17setupConfigPortalEv+0x68): undefined reference to DNSServer::setErrorReplyCode(DNSReplyCode const&)' .pio\build\pico32\src\main.cpp.o:(.literal._ZN15ESP_WiFiManager17setupConfigPortalEv+0x6c): undefined reference toDNSServer::start(unsigned short const&, String const&, IPAddress const&)' .pio\build\pico32\src\main.cpp.o:(.literal._ZN15ESPWiFiManager17startConfigPortalEPKcS1+0x24): undefined reference to DNSServer::stop()' .pio\build\pico32\src\main.cpp.o:(.literal._ZN15ESP_WiFiManager17startConfigPortalEPKcS1_+0x28): undefined reference toDNSServer::processNextRequest()' .pio\build\pico32\src\main.cpp.o: In function ESP_WiFiManager::setupConfigPortal()': C:\Users\Uli\Documents\PlatformIO\Projects\ESP32_Wifimanager_Testing/.pio\libdeps\pico32\ESP_WifiManager\src/ESP_WiFiManager-Impl.h:1457: undefined reference toDNSServer::DNSServer()'
C:\Users\Uli\Documents\PlatformIO\Projects\ESP32_Wifimanager_Testing/.pio\libdeps\pico32\ESP_WifiManager\src/ESP_WiFiManager-Impl.h:1457: undefined reference to DNSServer::setErrorReplyCode(DNSReplyCode const&)' C:\Users\Uli\Documents\PlatformIO\Projects\ESP32_Wifimanager_Testing/.pio\libdeps\pico32\ESP_WifiManager\src/ESP_WiFiManager-Impl.h:1457: undefined reference toDNSServer::start(unsigned short const&, String const&, IPAddress const&)' .pio\build\pico32\src\main.cpp.o: In function ESP_WiFiManager::startConfigPortal(char const*, char const*)': C:\Users\Uli\Documents\PlatformIO\Projects\ESP32_Wifimanager_Testing/.pio\libdeps\pico32\ESP_WifiManager\src/ESP_WiFiManager-Impl.h:1457: undefined reference toDNSServer::stop()' C:\Users\Uli\Documents\PlatformIO\Projects\ESP32_Wifimanager_Testing/.pio\libdeps\pico32\ESP_WifiManager\src/ESP_WiFiManager-Impl.h:1457: undefined reference to DNSServer::processNextRequest()' collect2.exe: error: ld returned 1 exit status *** [.pio\build\pico32\firmware.elf] Error 1

My assumption is that I have not included the DNSServer lib correctly into PIO. It would help to see how it has to be defined in platformio.ini file, but the link to the example file lead to a 404 message.

Thx

khoih-prog commented 4 years ago

Hi @uliatgithub

ESP32's DNSServer is a inherent part of ESP32 board package, and must have been installed automatically.

I think you either didn't install correctly or just forgot to install ESP32 board package to PIO.

Start from the simplest ESP32 sketch and identify the issue. It's also better to ask in PIO forum how to install correctly.