VSCode + ESP-IDF 问题 identifier XXX is undefined
VSCode + ESP-IDF 问题 identifier XXX is undefined
VSCode会出现错误提示如:
identifier "CONFIG_IDF_TARGET" is undefinedC/C++(20)
identifier "CONFIG_FREERTOS_HZ" is undefinedC/C++(20)
解决办法:
向 C++ Configurations
加入 "compileCommands": "${workspaceFolder}/build/
{
"configurations": [
{
"name": "ESP-IDF",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"compilerPath": "d:\\espressif\\tools\\xtensa-esp32s3-elf\\esp-12.2.0_20230208\\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
}