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"
    
}
相关推荐
太空1号8 小时前
SystemVerilog小白入门1, iverilog+VScode
vscode
^Lim9 小时前
vscode连接ubuntu18报Gilbc2.28错
ide·vscode·编辑器
北冥有鱼被烹18 小时前
【微知】vscode如何自动换行?(Option + Z)
vscode·编辑器
象骑士Hack1 天前
《RStudio》软件下载_《RStudio》安装包下载_《RStudio》安装教程下载_《RStudio》网盘下载
编辑器
JANGHIGH1 天前
VSCode编译器测试yolo环境配置
ide·vscode·yolo
忘梓.1 天前
Linux的写作日记:Linux基础开发工具(二):vim编辑器
linux·编辑器·vim
秃了也弱了。1 天前
VScode(Visual Studio Code)常用配置大全(持续更新)
ide·vscode·编辑器
徽先生1 天前
vscode中编写c++程序
c++·ide·vscode
_w_z_j_1 天前
Linux----使用vim编辑器
linux·编辑器·vim
Wang's Blog2 天前
Nestjs框架: 番外篇之如何基于VsCode调试nodejs项目
ide·vscode·编辑器