Build Link error in project_template

I was following the docs on to get used to ther board. but every time i try to use the esp_get_idf_version() or others esp_system.h function i got errors on my build.

when i try to build the project_template i got

Linking .pio\build\d1_mini\firmware.elf
.pio\build\d1_mini\src\user_main.o:(.text.user_init+0x4): undefined reference to `esp_get_idf_version'
.pio\build\d1_mini\src\user_main.o: In function `user_init':
user_main.c:(.text.user_init+0xe): undefined reference to `esp_get_idf_version'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\d1_mini\firmware.elf] Error 1

my wsl version is 1 and i am using the corresponding port ttyS5(COM5)

How can i fix it? when i build with make using ubuntu wsl it works

The “ESP8266_RTOS_SDK (ESP-IDF Style)” documentation does not apply at all because PlatformIO is using an extremely outdated version of the ESP8266 RTOS SDK before it was unified with ESP-IDF / converted to that style.


as such, I cannot recommend using PlatformIO if you want to develop for the latest ESP8266 RTOS SDK.