You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiling 'mcve' for 'LOLIN(WEMOS) D1 mini Pro'
ld.exe: mcve.cpp.o:(.text.setup+0x0): undefined reference to enableWiFiAtBootTime
ld.exe: mcve.cpp.o: in function setup
mcve.ino:4: undefined reference to enableWiFiAtBootTime
collect2.exe*: error: ld returned 1 exit status
Error linking for board LOLIN(WEMOS) D1 mini Pro
Build failed for project 'mcve'
Adding #include <ESP8266WiFi.h> helps, but in that case please
--- a/libraries/ESP8266WiFi/src/ESP8266WiFi.h
+++ b/libraries/ESP8266WiFi/src/ESP8266WiFi.h
@@ -53,6 +53,7 @@ extern "C" {
#define DEBUG_WIFI(...) do { (void)0; } while (0)
#endif
+extern "C" void enableWiFiAtBootTime (void) __attribute__((noinline));
class ESP8266WiFiClass : public ESP8266WiFiGenericClass, public ESP8266WiFiSTAClass, public ESP8266WiFiScanClass, public ESP8266WiFiAPClass {
public:
because compiler errror messages are usually more easily understood by users than linker errors.
In the line of business finding: The #define WIFI_HAS_EVENT_CALLBACK from commit d9a7a81 seems to have no known use, as such, could it be (re)moved, because it intertwines ESP8266WiFi with the core without need?
The text was updated successfully, but these errors were encountered:
@d-a-v I see you've picked up on this already, and your proposed change makes sense too, could you just please give my proposal to keep as much out of core as possible a reading, too? Declaring a symbol in core's includes that is defined and only available if and when the library is explicitly referenced anyway, seems confusing. I'm sure you will agree.
dok-net
added a commit
to dok-net/arduino-esp8266
that referenced
this issue
Apr 18, 2021
PR #7902 suggests that only adding one call,
enableWiFiAtBootTime()
, is sufficient to restore previous behavior. This is underlined by the commit log:suggesting that no additional includes from any library, in particular
#include <ESP8266WiFi.h>
is required for this to work.Unfortunately, this is not how the Arduino library resolver works, at least in my installation.
MCVE does not pass the link phase:
Result:
Adding
#include <ESP8266WiFi.h>
helps, but in that case pleaseand
because compiler errror messages are usually more easily understood by users than linker errors.
In the line of business finding: The
#define WIFI_HAS_EVENT_CALLBACK
from commit d9a7a81 seems to have no known use, as such, could it be (re)moved, because it intertwines ESP8266WiFi with the core without need?The text was updated successfully, but these errors were encountered: