Quando vou compilar, aparece todos esses erros:
C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5/tools/sdk/lib\libesp32.a(cpu_start.o):(.literal.main_task+0x14): undefined reference to app_main'
C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5/tools/sdk/lib\libesp32.a(cpu_start.o): In function
main_task':
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/cpu_start.c:545: undefined reference to app_main'
sketch\detectorBLE.ino.cpp.o:(.literal.startup._GLOBAL__sub_I_ssid+0xc): undefined reference to
IPAddress::IPAddress(unsigned char, unsigned char, unsigned char, unsigned char)'
sketch\detectorBLE.ino.cpp.o:(.literal.startup.GLOBAL__subI_ssid+0x10): undefined reference to String::String(char const*)'
sketch\detectorBLE.ino.cpp.o:(.literal.exit._GLOBAL__sub_D_ssid+0x0): undefined reference to
String::String()'
sketch\detectorBLE.ino.cpp.o: In function String()'
libraries\WiFi\WiFiSTA.cpp.o: In function _GLOBAL__sub_I_ssid':
C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\cores\esp32/IPAddress.h:94: undefined reference to
IPAddress::IPAddress(unsigned char, unsigned char, unsigned char, unsigned char)'
sketch\detectorBLE.ino.cpp.o: In function _GLOBAL__sub_I_ssid':
D:\arduino\detectorBLE/detectorBLE.ino:27: undefined reference to
String::String(char const*)'
sketch\detectorBLE.ino.cpp.o: In function _GLOBAL__sub_D_ssid':
D:\arduino\detectorBLE/detectorBLE.ino:27: undefined reference to
String::_GLOBAL__sub_I__ZN12WiFiSTAClass14_autoReconnectE':
C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\cores\esp32/IPAddress.h:94: undefined reference to
IPAddress::IPAddress(unsigned char, unsigned char, unsigned char, unsigned char)'
libraries\WiFi\WiFiSTA.cpp.o: In function _GLOBAL__sub_I__ZN12WiFiSTAClass14_autoReconnectE':
C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\libraries\WiFi\src/WiFiSTA.cpp:74: undefined reference to
String::String(char const*)'
libraries\WiFi\WiFiSTA.cpp.o: In function _GLOBAL__sub_D__ZN12WiFiSTAClass14_autoReconnectE':
C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\libraries\WiFi\src/WiFiSTA.cpp:74: undefined reference to
String::~String()'
libraries\WiFi\WiFiGeneric.cpp.o: In function _GLOBAL__sub_I__Z14postToSysQueueP19system_prov_event_t':
C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\libraries\WiFi\src/WiFiGeneric.cpp:200: undefined reference to
IPAddress::IPAddress(unsigned char, unsigned char, unsigned char, unsigned char)'
libraries\WiFi\ETH.cpp.o: In function _GLOBAL__sub_I__ZN8ETHClassC2Ev':
C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\cores\esp32/IPAddress.h:94: undefined reference to
IPAddress::IPAddress(unsigned char, unsigned char, unsigned char, unsigned char)'
libraries\WiFi\WiFi.cpp.o: In function _GLOBAL__sub_I__ZN9WiFiClass9printDiagER5Print':
C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\cores\esp32/IPAddress.h:94: undefined reference to
IPAddress::IPAddress(unsigned char, unsigned char, unsigned char, unsigned char)'
libraries\WiFi\WiFiAP.cpp.o: In function _GLOBAL__sub_I__ZN11WiFiAPClass6softAPEPKcS1_iii':
C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\cores\esp32/IPAddress.h:94: undefined reference to
IPAddress::IPAddress(unsigned char, unsigned char, unsigned char, unsigned char)'
libraries\WiFi\WiFiClient.cpp.o: In function _GLOBAL__sub_I__ZN10WiFiClientC2Ev':
C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\cores\esp32/IPAddress.h:94: undefined reference to
IPAddress::IPAddress(unsigned char, unsigned char, unsigned char, unsigned char)'
libraries\WiFi\WiFiMulti.cpp.o:C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\cores\esp32/IPAddress.h:94: more undefined references to `IPAddress::IPAddress(unsigned char, unsigned char, unsigned char, unsigned char)' follow
collect2.exe: error: ld returned 1 exit status
exit status 1
Erro compilando para a placa ESP32 Dev Module
Isso acontece quando coloco a biblioteca <WiFi.h>. Segue abaixo o código //-----WI_FI------
#include <WiFi.h>
const char* ssid = "meu_wifi"; const char* password = "12345";
// --- Bluetooth ---
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEScan.h>
#include <BLEAdvertisedDevice.h>
int scanTime = 5; //In seconds int nivelRSSI = -78; String dispositivosAutorizados = "10:39:17:0a:83:9c";
// --- Setup --- void setup() { Serial.begin(115200); conectarWifi(); Serial.println("Scanning..."); BLEDevice::init("");
}
Alguem sabe resolver?
Obrigado