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"
    
}
相关推荐
山峰哥3 天前
吃透 SQL 优化:告别慢查询,解锁数据库高性能
服务器·数据库·sql·oracle·性能优化·编辑器
holeer3 天前
【V1.0】Typora 中的 HTML 支持|软件文档自翻译
前端·编辑器·html·typora·web·markdown·文档
硬汉嵌入式3 天前
Vim 9.2版本正式发布
编辑器·vim
Hello World . .3 天前
Linux:线程间通信
linux·开发语言·vscode
被制作时长两年半的个人练习生3 天前
claude code for vscode 配置 qwen3.5
ide·vscode·claude code·qwen3.5
圣心3 天前
Visual Studio Code 中的 AI 智能操作
ide·人工智能·vscode
吹牛不交税3 天前
关于vscode左侧资源管理器目录层级疑似异常的问题
ide·vscode·编辑器
嵌入小生0073 天前
线程间通信---嵌入式(Linux)
linux·c语言·vscode·嵌入式·互斥锁·线程间通信·信号量
琛説3 天前
彻底解决 Codex / Copilot 修改中文乱码【含自动化解决方案】
vscode·copilot·codex
学嵌入式的小杨同学3 天前
嵌入式硬件开发入门:PCB 设计核心流程 + 基础元器件实战指南
vscode·后端·嵌入式硬件·架构·vim·智能硬件·pcb工艺