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
}

参考identifier "CONFIG_IDF_TARGET" is undefined和identifier "CONFIG_FREERTOS_HZ" is undefined (VSC-1138) #1008

posted @ 2023-10-09 16:29  Champrin  阅读(791)  评论(0编辑  收藏  举报