vscode打造C环境

vscode打造C环境

  1. 安装LLVM + Clang

    ubuntu18.04官方源中Clang的默认最新版是6.0,直接apt安装即可:

    sudo apt install llvm clang libc++-dev libc++abi-dev
    
  2. vscode自带的微软官方C/C++插件功能已经很好了,朱需要配置c_cpp_properties.json就可以解决头文件出现红波浪线了:


   ​    "configurations": [

   ​        {

   ​            "name": "Linux",

   ​            "browse": {

   ​                "path": [

   ​                    "/usr/include",

   ​                    "/usr/local/include",

   ​                    "${workspaceRoot}",

   ​                    "/usr/include/c++/7",

   ​                    "/usr/include/c++/v1",

   ​                    "${workspaceFolder}"

   ​                ],

   ​                "limitSymbolsToIncludedHeaders": true,

   ​                "databaseFilename": ""

   ​            },

   ​            "includePath": [

   ​                "/usr/include",

   ​                "/usr/local/include",

   ​                "${workspaceRoot}",

   ​                "/usr/include/c++/7",

   ​                "/usr/include/c++/v1"

   ​            ],

   ​            "defines": [

   ​                "_DEBUG",

   ​                "UNICODE",

   ​                "_UNICODE"

   ​            ],

   ​            "compilerPath": "/usr/bin/clang",

   ​            "cStandard": "c11",

   ​            "cppStandard": "c++17",

   ​            "intelliSenseMode": "clang-x64"

   ​        }

   ​    ],

   ​  "version": 4

你可能感兴趣的:(c,工具,ubuntu)