Esp32_mock.h undefined esp_websocket_client


I am trying to add esp_websocket_client component to my project.

I have added the mdns component (same repo) in the same way, just dropping it into the component folder.

It seems to work fine for detecting the component, but the lwip library is making things difficult.

This is the error chain thats happening:
myfile: #include “esp_websocket_client.h”
esp_websocket_client.h:17 - #include <sys/socket.h>
lwip port esp32 socket.h:33 - #include “lwip/sockets.h”
lwip include lwip socket.h:8 - #include_next “lwip/sockets.h”

at which point i can’t follow it anymore but it says:
cannot open source file “esp32_mock.h” (dependency of “lwip/sockets.h”)

So what kind of setting am i missing? is the component incorrectly included ? is something in my .ini file not well defined or in my config since apparently the sp32 socket implementation is missing?

platform = espressif32@6.3.0 ;  ESP-IDF v5.0.2
board = esp32dev
framework = espidf
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
board_build.partitions = partition_table.csv
board_build.flash_mode = qio
build_flags = 
upload_port = /dev/ttyUSB*
monitor_port = /dev/ttyUSB*

compiling works fine, just intelisense is wrecked

Bumping this thread. Having the exact same problem

Just got this problem, trying to write my first sntp program with esp32 / idf / lwip.

I looked for this not found include file named “esp32_mock.h” and found it (my tip : I added the ~/.platformio/packages/framework-espidf folder in my vscode workspace for easy navigation inside of the framework api)

esp32_mock.h is located in folder components/lwip/test_afl_host. The readme file in that folder confirms that it is a folder for a test suite.

EDIT 1 :
After checking the github of espressif32 GitHub - espressif/esp-idf: Espressif IoT Development Framework. Official development framework for Espressif SoCs., I could find this file in releases up to v5.0 included :

Starting from release v5.1, this file does not exist anymore.

EDIT 2 :
Seems to be restricted to linux environment ? I found that snippet in each file referencing this include file (except esp32_mock.c, but one can safely assume that this is not causing our problem)

#ifdef __linux__
#include "esp32_mock.h"

EDIT 3 :
Created an issue : Include errors caused by 'esp32_mock.h' in idf up to v5.0 · Issue #1153 · platformio/platform-espressif32 · GitHub