1、检测到 #include 错误。请更新 includePath。已为此翻译单元禁用波形曲线。

解决在点击查看命令面板

找到C/C++:编辑配置(JSON)

正在c_cpp_properties.json添加如下内容:
{
"configurations": [
{
"name": "ESP-IDF",
"compilerPath": "${config:idf.toolsPathWin}\\tools\\xtensa-esp32s3-elf\\esp-2022r1-11.2.0\\xtensa-esp32s3-elf\\bin\\xtensa-esp32s3-elf-gcc.exe",
"includePath": [
"${config:idf.espIdfPath}/components/**",
"${config:idf.espIdfPathWin}/components/**",
"${config:idf.espAdfPath}/components/**",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}/**"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${config:idf.espAdfPath}/components/**",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": false
}
}
],
"version": 4
}

没有报错

2、解决显示未定义标识符 "CONFIG_FREERTOS_HZ
"compileCommands": "${workspaceFolder}/build/compile_commands.json"以解决问题。


本文介绍了如何修复C/C++项目中遇到的#include路径错误和未定义标识符问题,通过调整ESP-IDF配置文件中的includePath和使用compileCommands来确保正确编译。
1万+

被折叠的 条评论
为什么被折叠?



