VSCode使用MSVC编译器

1.其他大佬的配置:下载和安装库环境

2.安装好C/C++插件<选择1.8.4的版本最好>。

3.分别生成对应的默认模板即可。但是其中参数可能需要配置。
task.json

cpp 复制代码
{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "cppbuild",
			"label": "C/C++: cl.exe build active file",
			"command": "cl.exe",
			"args": [
				"/Zi",
				"/EHsc",
				"/nologo",
				"/Fe:",
				"${fileDirname}\\${fileBasenameNoExtension}.exe",
				"${file}"
			],
			"options": {
				"cwd": "${fileDirname}"
			},
			"problemMatcher": [
				"$msCompile"
			],
			"group": {
				"kind": "build",
				"isDefault": true
			},
			"detail": "compiler: cl.exe"
		}
	]
}

launch.json

cpp 复制代码
{
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(Windows) Launch",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [
            ],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "console":"integratedTerminal"
        },
        
        
    ],
    "preLaunchTask": "C/C++: cl.exe build active file"
    
}
相关推荐
小杍随笔35 分钟前
【Zed 编辑器汉化版本推荐:使用 TC999/zed-loc 项目快速实现中文界面】
编辑器
电子科技圈37 分钟前
IAR与Quintauris携手推进RISC-V汽车实时应用的功能安全软件开发
嵌入式硬件·安全·设计模式·编辑器·汽车·risc-v
詹姆斯bind2 小时前
基于Div contenteditable 属性 实现一个 “只读” 标签编辑器
vue.js·编辑器·contenteditable
诗意地回家4 小时前
niuhe.conf 配置文件说明
vscode·go
摇滚侠4 小时前
VsCode 自带的 Git 使用教程
ide·git·vscode
zyplayer-doc5 小时前
重写OFD查看器,完善PDF查看器,增加搜索历史记录、滚动分页、目录排序等,zyplayer-doc 2.5.7 发布啦!
pdf·编辑器·飞书·开源软件·创业创新·有道云笔记
咯哦哦哦哦7 小时前
linux patchelf工具 用法
linux·vscode·编辑器·gcc
Molesidy8 小时前
【VSCode】使用 VSCode + EIDE插件 的开发STM32的超详细教程
ide·vscode·stm32·编辑器·eide
bank_dreamer8 小时前
VSCODE前端代码风格格式化
前端·css·vscode·html·js·prettier·代码格式化