VScode cl配置

配置参考:

windows环境下VSCode配置C++教程(使用msvc编译器)-优快云博客

VSCode配置msvc编译调试环境_vscode msvc-优快云博客

异常参考:

vscode调试c++断点失效解决方法_vscode断点变空心-优快云博客

`task.json`  相当于使用powershell 执行cl.exe,然后添加上一些参数;

可以使用shift+ctrl+b来运行

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "C/C++ Executable: build current active file",
            "type": "shell",
            "command": "cl.exe",
            "args": [
                "/EHsc", "${file}",
                "/Fo:",  "${fileDirname}\\",
                "/Fe:",  "${fileDirname}\\${fileBasenameNoExtension}.exe",
                "/DEBUG",
            ],
            "problemMatcher": "$msCompile",
            "detail": "Build only the current active file."
        },
    ]
}

c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "intelliSenseMode": "windows-msvc-x64",
            "compilerPath": "D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe",
            "cStandard": "c17",
            "cppStandard": "c++20",
            "windowsSdkVersion": "10.0.22621.0"
        }
    ],
    "version": 4
}

launch.json可以通过运行-添加配置-选择cl来生成;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值