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"
    
}
相关推荐
小妖66633 分钟前
vscode chrome调试怎么在所有浏览器都好使
ide·chrome·vscode
Tunny_yyy2 小时前
VScode与远端服务器SSH链接
服务器·vscode·ssh
黑科技编辑器2 小时前
适合五一劳动节的SVG模版
编辑器·新媒体运营·交互·微信公众平台
猫头虎3 小时前
如何解决IDE项目启动报错 error:0308010C:digital envelope routines::unsupported 问题
javascript·ide·vue.js·typescript·node.js·编辑器·vim
炫酷的伊莉娜6 小时前
Cursor —— AI编辑器 使用详解
人工智能·编辑器
PassLink_8 小时前
[Jupyter Notebook]:Jupyter Notebook 安装教程(代码编辑器)
ide·jupyter·编辑器·环境变量·python 安装·notebook 安装教程
Bob99981 天前
Amlogic S905L3系列盒子 ROM DIY相关
java·javascript·数据仓库·vscode·eclipse·tomcat·vim
Humbunklung1 天前
Visual Studio Code 使用tab键往左和往右缩进内容
ide·vscode·编辑器
pink大呲花1 天前
设置右键打开VSCode
ide·vscode·编辑器
春蕾夏荷_7282977251 天前
vscode 使用gitcode团队管理项目
vscode·gitcode