Platformio ESP32 TCP compile errors

I’ve been using platformIO extension for vscode to develop my esp32 projects. I’ve never had problems compiling and uploading projects, but in the last few days none of my (working) projects compile properly anymore.

These are the errors I get:

C:/Users/Afonso Muralha/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcpip_adapter/tcpip_adapter.h:112:5: error: 'ip_addr_t' does
not name a type

C:/Users/Afonso Muralha/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcpip_adapter/tcpip_adapter.h:166:49: error: 'tcpip_adapter_ip_info_t' has not been declared

C:/Users/Afonso Muralha/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcpip_adapter/tcpip_adapter.h:182:49: error: 'tcpip_adapter_ip_info_t' has not been declared

C:/Users/Afonso Muralha/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcpip_adapter/tcpip_adapter.h:407:72: error: 'ip6_addr_t' has not been declared

C:/Users/Afonso Muralha/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcpip_adapter/tcpip_adapter.h:609:76: error: 'tcpip_adapter_sta_list_t' has not been declared

C:/Users/Afonso Muralha/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcpip_adapter/tcpip_adapter.h:665:1: error: expected declaration before '}' token

Finally, here’s my .ini file:

platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200

Any help would be much appreciated!

Can you give a minimal code example in which the error occurs?

Thank you for the reply.

Including the libraries is enough to cause the error:

#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <WiFiUdp.h>
#include <ESPAsyncWebServer.h>
#include <AsyncTCP.h>
#include <WiFiAP.h>

I tried to reinstall vscode and platformio as well as trying it on atom. Could this be caused by a platformio update? Maybe something related to the internal platformio libraries?

PS: It seems that even including only the Wifi.h library also causes the same error.

I can’t reproduce that on my end… I have no compile errors sing your platformio.ini environment, against the current ESP32 board support, and only including the libraries you listed with an empty setup and loop. I did add lib_deps = 306 so that the ESPAsyncWebServer library and dependencies got installed, that shouldn’t change anything, as your errors seem to be coming from something within the core. Maybe it’s worth deleting the platform files, and getting PlatformIO to re-download/reinstall them, in case there is some file corruption going on? (PIO Home -> Platforms -> Installed -> Espressif 32 -> Uninstall)?

Otherwise, you could perhaps look at C:/Users/Afonso Muralha/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip/lwip/ip_addr.h , and see if you have the definition for ip_addr_t there between lines 69 and 76… as it is where it looks to be defined… if it’s not there… something is missing!

So, I reinstalled the platform files, cleaned the project and tried to recompile. Still having the same issue.
I tried the same thing but with and older version (1.4.0) and it seems to be working now. I have no idea how that fixed it :confused: .

Also had the same problem for no apparent reason on previously working projects, adding


to sdkconfig.h fixed it for me


Thanks for the tip, I’ll try that if I encounter that error again :+1: