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"
    
}
相关推荐
CaptainDrake44 分钟前
React低代码项目:问卷编辑器
react.js·低代码·编辑器
Williams101 小时前
解锁高效开发新姿势:Trae AI编辑器深度体验
人工智能·编辑器
白云千载尽14 小时前
ubuntu环境中安装latex并使用vscode
linux·vscode·ubuntu
椰萝Yerosius17 小时前
计算机工具基础(五)——Vim
linux·编辑器·vim
m0_748234081 天前
Node.js使用教程
node.js·编辑器·vim
朗迹 - 张伟1 天前
UE5 编辑器辅助/加强 插件搜集
ue5·编辑器
你若盛开,清风自来!1 天前
在VSCode中安装jupyter跑.ipynb格式文件
vscode·jupyter·pyathon
莲动渔舟1 天前
国产编辑器EverEdit - 贴心的AES加密功能
编辑器·emeditor·notepad·everedit
2401_882727971 天前
组态软件在物联网中的应用
运维·前端·物联网·数学建模·编辑器
大河qu1 天前
IDE/Mermaid + VSCode + Deepseek 生成可视化流程图和UML图
ide·vscode·mermaid·可视化图表·deepseek