配置 VSCode 包含路径

har*_*per 5 visual-studio-code

我使用 VSCode 编辑 Xilinx SDK 文件。VSCode 发出“问题”,其中包括找不到路径。

我使用灯泡“显示修复”:

添加到“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”的正确路径。

include 配置有什么问题?

{
    "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
}
Run Code Online (Sandbox Code Playgroud)

这是 VSCode 抱怨的一行:

#include <stdint.h>
Run Code Online (Sandbox Code Playgroud)

编辑:

每次接受“修复”都会导致“includePath”中出现一条具有相同路径的附加行,但这并不能解决问题。所以你在c_cpp_properties.json转储中看到的内容是由“修复”引起的。

Sco*_*eak 0

您的问题似乎与我最近发布的另一个答案c_cpp_properties.json中的问题相同。总结一下:

  1. 添加compilerPath
  2. 更改intelliSenseModegcc-x86gcc-x64。(不知道是哪一个,没有gcc-arm选择。)
  3. 查看教程
  4. 尝试运行“C/C++:日志诊断”和“gcc -v -E -dD”。

请参阅链接的答案以获取更多提示和详细信息。


归档时间:

查看次数:

6291 次

最近记录:

5 年,6 月 前