首页 > 编程语言 > 详细

set .vscode for c++

时间:2020-07-05 09:24:50      阅读:63      评论:0      收藏:0      [点我收藏+]

set .vscode for c++

reference

pre-requisite

  1. mingw64
  2. vscode and its extensions for c++
// c_cpp_properties.json
{ // >c/c++ configurations(ui)
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "D:/Apps/mingw64/bin/g++.exe", // >(ui)
            "cStandard": "c11",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "gcc-x64" // >(ui)
        }
    ],
    "version": 4
}
// tasks.json
{ // >tasks: configure default build task
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "g++.exe build",
            "command": "D:/Apps/mingw64/bin/g++.exe",
            "args": [
                "-g",
                "D:/Codes/cpp/${fileBasenameNoExtension}.cpp", // hard-coded in{.cpp}
                "-o",
                "D:/Codes/cpp/.out/${fileBasenameNoExtension}.exe" // hard_coded out{.exe}
                // "${fileDirname}/${fileBasenameNoExtension}.exe"
            ],
            "options": {
                // "cwd": "D:/Apps/mingw64/bin"
                "cwd": "D:/Apps/Git/bin"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build", // ctrl-shift-b to build
                "isDefault": true
            }
        }
    ]
}
// settings.json
{ // >preferences:open settings(json)
	"editor.formatOnSave": true, // ctrl-shift-x: clang-format
}

set .vscode for c++

原文:https://www.cnblogs.com/qhinqiwei/p/13237446.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!