vscode 下编译window api

{
    // 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": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\15.0\\Bin\\msbuild",
            "args": [
                "myapp.vcxproj",
                "/property:GenerateFullPaths=true",
                "/t:build",
                "/p:TargetVersion=Windows10",
                "/p:TargetPlatformVersion=10.0.17763.0",
                "/consoleloggerparameters:NoSummary"
            ],
            "group": "build",
            "presentation": {},
            "problemMatcher": "$msCompile"
        },
        {
            "label": "gccbuild",
            "type": "shell",
            "command": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-win32-seh-rt_v6-rev0\\mingw64\\bin\\gcc",
            "args": [
                "main.cpp",
                "-mwindows",
                "-o my.exe"
            ],
            "group": "build",
            "presentation": {},
            "problemMatcher": [
                "$gcc"
            ]
        },
        {
            "type": "shell",
            "label": "cl.exe build active file",
            "command": "cl.exe",
            "args": [
                "/Zi",
                "/EHsc",
                "/Fe:",
                "${fileDirname}\\${fileBasenameNoExtension}.exe",
                "${file}"
            ],
            "problemMatcher": [
                "$gcc"
            ],
            "group": "build"
        }
    ]
}

 经过测试,msbuild和mingw-w64下的gcc都可以执行编译,msbuild可以使用node下的windows-build-tools模块来安装,安装过程中会安装msbuild和py。

vscode 下编译window api

上一篇:AcWing - 332 - 股票交易 = 单调队列优化dp


下一篇:初中英语词组