Configure VSCode include path

岁酱吖の 提交于 2021-02-09 07:29:44

问题


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":

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

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.

What's wrong with the include configuration?

{
    "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
}

That's the line complained by VSCode:

#include <stdint.h>

Edit:

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".


回答1:


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

  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.



来源:https://stackoverflow.com/questions/53369537/configure-vscode-include-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!