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"
    
}
相关推荐
guslegend11 小时前
第2节:AI编辑器底层技术全景导览
人工智能·编辑器
小铁-Android12 小时前
Visual Studio Code创建Flutter项目时包名组织名更改
vscode·flutter
2501_9151063216 小时前
iOS开发工具有哪些?iOS 开发每个阶段的实用工具
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
OliverH-yishuihan16 小时前
【保姆级教程】Win11 下从零部署 Claude Code:本地环境配置 + VSCode 可视化界面全流程指南
ide·vscode·编辑器
TakeForge17 小时前
17天跑通交通行业SVG编辑器
编辑器
键盘飞行员17 小时前
macOS Trae 解决 Codex 插件不显示问题(官方适配版)
macos·编辑器·ai编程
IOT.FIVE.NO.118 小时前
[多agent工作]Codex+claudecode+vscode+copilot 自定义deepseek api加全套安装agent工作流程
ide·vscode·copilot
梦想的颜色18 小时前
Docker 入门指南:从零开始掌握容器化技术
运维·服务器·vscode·python·算法·docker·云原生
Cloud_Shy61818 小时前
解读《Effective Python 3rd Edition》:从练气到老魔(第二章 Item 10 - 12)
c语言·开发语言·网络·人工智能·windows·python·编辑器
木古古181 天前
搞一个高效的c/c++开发环境,工具VIm+自研vim插件+Shell脚本
linux·编辑器·vim