Page 1 of 1

Help needed: clangd in VSCode with ESP-IDF reports printf function not found error

Posted: Wed Sep 24, 2025 3:43 am
by 1403847775@qq.com
The following is the complete source code, which compiles successfully but triggers errors in clangd.
#include "driver/gpio.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

#define OUT_GPIO GPIO_NUM_15
#define OUT_MASK (1ULL<<OUT_GPIO)

void app_main(void)
{
gpio_config_t io_conf={OUT_MASK,GPIO_MODE_OUTPUT,GPIO_PULLUP_DISABLE,GPIO_PULLDOWN_DISABLE,GPIO_INTR_DISABLE};
gpio_config(&io_conf);
while(true)
{
gpio_set_level(OUT_GPIO, 1);
vTaskDelay(1000/portTICK_PERIOD_MS);
printf("输出一\n");
gpio_set_level(OUT_GPIO, 0);
vTaskDelay(1000/portTICK_PERIOD_MS);
printf("输出零\n");
}
}

Re: Help needed: clangd in VSCode with ESP-IDF reports printf function not found error

Posted: Wed Sep 24, 2025 9:27 am
by MicroController
Try adding #include <stdio.h>.

Re: Help needed: clangd in VSCode with ESP-IDF reports printf function not found error

Posted: Thu Sep 25, 2025 8:58 am
by 1403847775@qq.com
Try adding #include <stdio.h>.
I've already attempted this, yet clangd persists in reporting 'printf function not found'.