vscode 中未包含 ros/ros.h的解决办法

在c_cpp_properties.json中添加 “compileCommands”:"${workspaceFolder}/build/compile_commands.json" 就可以了。
代码如下
c_cpp_properties.json:

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64",
            "compileCommands": "${workspaceFolder}/build/compile_commands.json"//在这里加入这行代码
        }
       
    ],
    "version": 4
}

然后就可以了。
参考:https://blog.csdn.net/weixin_35695879/article/details/85254422

你可能感兴趣的:(学习杂文)