VS Code - Programming C - task.json & c_cpp_properties.json

分享一個自用的gcc編譯配置文件,Windows 10系統安裝MinGW。
VS Code安裝 Microsoft C/C++ 插件。

c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "C:/MinGW/include/",
                "C:/MinGW/lib/gcc/mingw32/6.3.0/include",
                "${workspaceRoot}"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE"
            ],
            "intelliSenseMode": "msvc-x64",
            "browse": {
                "path": [
                    "C:/MinGW/include/",
                    "C:/MinGW/lib/gcc/mingw32/6.3.0/include",
                    "${workspaceRoot}"
                ],
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": ""
            }
        }
    ],
    "version": 3
}

task.json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build",
            "type": "shell",
            "command": "gcc",
            "args": [
                "-std=c99",
                "-o",
                "'${fileDirname}\\${fileBasenameNoExtension}'",
                "'${file}'"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        }
    ]
}

你可能感兴趣的:(VS Code - Programming C - task.json & c_cpp_properties.json)