配置 VSCode 包含路径 [英] Configure VSCode include path

查看:114
本文介绍了配置 VSCode 包含路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 VSCode 来编辑 Xilinx SDK 文件.VSCode 问题包括找不到路径的问题".

I use VSCode to edit Xilinx SDK files. The VSCode issues "problems" that include path can't be found.

我使用了灯泡显示修复":

I used the bulb "show fixes":

添加到includePath":D:/Other/Xilinx/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/6.2.1/include

Add to "includePath": D:/Other/Xilinx/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/6.2.1/include

但是 VSCode 仍然抱怨缺少包含路径,尽管每个 Add to "includePath" 都会在项目 .vscode 文件夹中添加到c_cpp_properties.json"的正确路径.

But VSCode is still complaining about the missing include path, although each Add to "includePath" adds a correct path to "c_cpp_properties.json" in the projects .vscode folder.

包含配置有什么问题?

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "${workspaceFolder}/standalone_bsp_0/ps7_cortexa9_0/include",
                "D:/Other/Xilinx/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/6.2.1/include",
                "D:/Other/Xilinx/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/6.2.1/include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "8.1",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "msvc-x64"
        }
    ],
    "version": 4
}

VSCode 抱怨的那句话:

That's the line complained by VSCode:

#include <stdint.h>

每次接受修复"都会导致includePath"中具有相同路径的附加行,但这并不能解决问题.因此,您在 c_cpp_properties.json 转储中看到的内容是由修复"引起的.

Each accepting of the "fix" causes an additional line with the same path in "includePath", but this doesn't solve the problem. So what you see in the c_cpp_properties.json dump is caused by the "fix".

推荐答案

您的 c_cpp_properties.json 似乎与 另一个答案 我最近发布了.总结一下:

Your c_cpp_properties.json appears to have the same problems as in another answer I recently posted. To summarize:

  1. 添加compilerPath.
  2. intelliSenseMode 更改为 gcc-x86gcc-x64.(不确定哪个,没有 gcc-arm 选项.)
  3. 查看教程.
  4. 尝试运行C/C++:日志诊断"和gcc -v -E -dD".
  1. Add compilerPath.
  2. Change intelliSenseMode to gcc-x86 or gcc-x64. (Not sure which, there is no gcc-arm option.)
  3. Check out the tutorial.
  4. Try running "C/C++: Log Diagnostics" and "gcc -v -E -dD".

有关更多提示和详细信息,请参阅链接的答案.

See the linked answer for a few more hints and details.

这篇关于配置 VSCode 包含路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆