vscode打开esp-idf工程,找不到头文件,有波浪线

就像这样
在这里插入图片描述
多半是因为原始的工程不是用vscode的插件新建的,因此没有相关的路径。需要在工程文件夹下的.vscode文件夹中的c_cpp_properties.json文件中增加路径,可以参考插件自动新建的工程里面的写法

{
    "configurations": [
        {
            "name": "ESP-IDF",
            "compilerPath": "${config:idf.toolsPathWin}\\tools\\riscv32-esp-elf\\esp-12.2.0_20230208\\riscv32-esp-elf\\bin\\riscv32-esp-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
}

改成这样的就可以了。
在这里插入图片描述
仅供参考,原理就是这样,如果不行就自己用插件新建一个工程,去看看插件是怎么生成的,复制一下即可。
有人写的文章说明怎么解决这个问题都要付款才能看,简直想钱想疯了。

最近更新

  1. TCP协议是安全的吗?

    2024-05-13 03:48:04       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-05-13 03:48:04       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-05-13 03:48:04       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-05-13 03:48:04       20 阅读

热门阅读

  1. 监听 Redis key 过期事件无效的问题

    2024-05-13 03:48:04       13 阅读
  2. 《认知觉醒》阅读记录

    2024-05-13 03:48:04       9 阅读
  3. 【GoLang基础】select语句是什么?

    2024-05-13 03:48:04       13 阅读
  4. 31Windows精简系统下载推荐

    2024-05-13 03:48:04       15 阅读
  5. Redis——入门简介

    2024-05-13 03:48:04       11 阅读
  6. Alibaba Cloud Linux 安装mysql及注意事项

    2024-05-13 03:48:04       15 阅读
  7. [Linux深度学习笔记5.8]

    2024-05-13 03:48:04       13 阅读
  8. C++中合成的默认构造函数的访问权限

    2024-05-13 03:48:04       13 阅读