VS code:增加修改头文件路径

F1Ctrl+Shift+p 在弹出的备选选项中选择 C/C++:Edit Configuration(JSON)
在这里插入图片描述
自动打开c_cpp_properties.json配置文件,如下:
configurationsincludePath中添加路径,路径名称用双引号标注,以逗号分隔。

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

猜你喜欢

转载自blog.csdn.net/xue_nuo/article/details/107766688