如何修复 ESP32 too few arguments to function 'esp_err_t esp_wifi_sta_wpa2_ent_enable(const esp_wpa2_config_t*)'
问题:
尝试编译你的 ESP32 应用程序时,你看到此编译器错误:
src/main.cpp
src\\main.cpp: In function 'void wifiConnectWPAEAP(const char*, const char*, const char*, const char*)':
src\\main.cpp:23:32: error: too few arguments to function 'esp_err_t esp_wifi_sta_wpa2_ent_enable(const esp_wpa2_config_t*)' esp_wifi_sta_wpa2_ent_enable();
^解决方案
替换
main.cpp
esp_wifi_sta_wpa2_ent_enable();为
main.cpp
esp_wpa2_config_t config = WPA2_CONFIG_INIT_DEFAULT();
esp_wifi_sta_wpa2_ent_enable(&config);Check out similar posts by category:
C/C++, Embedded, ESP8266/ESP32
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow