I originally thought this issue is related to my earlier question that @tera kindly solved, but the addition of back-ticks to escape the reserved name doesn't work here.
I am trying to call WiFi.begin(ssid, password);
but the compiler errors with:
value of type 'WiFiClass' has no member 'begin'
I am trying to use another Arduino library that uses 'begin' and the compiler gives the same error, so I think there is something generic going on. I suspect that swift is mixing the function name with the iterator version and, as WiFi does not have an iterator, it reports the error.
I have overcome the immediate issue of it failing to compile by creating a .hpp
file containing:
#include <WiFi.h>
inline void start_wifi() {WiFi.begin("boo", "hoo"); }
and including this in BridgingHeader.h
.
Sadly, this just moves me seamlessly to a linker error:
undefined reference to `WiFiSTAClass::begin(char const*, char const*, int, unsigned char const*, bool)'
This seems to be due to it including the generic Arduino library rather than the specific ESP32 version, but everywhere I can, it specifies the correct version.
Could you try explicitly linking against the library that provides WiFiSTAClass
by passing -l<library name>
flag?
Hi, thanks. I think the problem is that the function isn't getting built into the final version of libarduino.a - I can see it as far as build/esp-idf/arduino/libarduino.a(WiFiScan.cpp.obj)
but it doesn't exist in `esp-idf/main/libarduino.a. It seems very strange because it clearly knows about the defaulted parameters that I am not using in my source code, so the header is working correctly.