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"
    
}
相关推荐
Aspect of twilight33 分钟前
vscode python debug方式
ide·vscode·python·debug
啃火龙果的兔子2 小时前
vscode中可以使用的免费的AI编程工具有哪些
ide·vscode·ai编程
littlezls3 小时前
在VSCode中运行Python脚本文件时如何传参
vscode·python
宋明炜3 小时前
VSCode + MSYS2 配置 C 语言开发环境(详细步骤)
c语言·ide·vscode
yscript3 小时前
GPU分配BUG: Duplicate GPU detected : rank 1 and rank 0 both on CUDA device d5000
linux·运维·服务器·vscode·bug
超超~~4 小时前
Notepad(文本编辑器)v3.6.30绿色官方版
编辑器·notepad++
shhpeng5 小时前
Visual Studio Code 下 go 开发环境搭建
ide·vscode·编辑器
为什么要内卷,摆烂不香吗5 小时前
sed 流编辑器练习自用
linux·运维·编辑器
newobut14 小时前
vscode远程调试python程序,基于debugpy库
vscode·python·调试·debugpy
潮流coder17 小时前
vscode修改缓存保存路径
ide·vscode·缓存