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"
    
}
相关推荐
Arong-tina3 小时前
VScode调试能实现和Pycharm一样的tensor shape,ssh远程连接linux服务器版
ide·vscode·pycharm
学嵌入式的小杨同学4 小时前
STM32 进阶封神之路(二十五):ESP8266 深度解析 —— 从 WiFi 通信原理到 AT 指令开发(底层逻辑 + 实战基础)
c++·vscode·stm32·单片机·嵌入式硬件·mcu·智能硬件
专注VB编程开发20年4 小时前
vscode插件开发/ 编辑器 事件大全
ide·vscode·编辑器
FatHonor4 小时前
【golang学习之旅】使用VScode安装配置Go开发环境
vscode·学习·golang
栗子甜酒5 小时前
统信系统下载VScode+Node
ide·vscode·编辑器
zz9602266 小时前
编辑器工具sublimetext配置
编辑器
sjmaysee7 小时前
vscode配置django环境并创建django项目(全图文操作)
vscode·django·sqlite
慕诗客8 小时前
VSCODE+EIDE编译和下载单片机程序
ide·vscode·单片机
嗡嗡嗡qwq8 小时前
【如何使用vscode+github copilot会更加省额度】
vscode·github·copilot
Codigger官方9 小时前
Neovim 全新开场画面:终端编辑器的“门面“进化史
编辑器