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"
    
}
相关推荐
weixin_307779131 小时前
VS Code配置MinGW64编译backward库
开发语言·c++·vscode·算法
QL.ql14 小时前
vscode的ws环境,esp32s3连接wifi
ide·vscode·编辑器
_错错错18 小时前
Vim 常用快捷键及插件
编辑器·vim·linux 开发工具
大白同学4211 天前
【Linux】编辑器vim的使用
linux·编辑器·vim
Hyvial1 天前
VsCode 使用指南(配置 + 美化)
vscode
星火飞码iFlyCode1 天前
真实案例 | 如何用iFlyCode开发Webpack插件?
java·python·编辑器
十秒耿直拆包选手1 天前
IDE:vscode的vue3模板
javascript·ide·vscode
东方不败耶耶耶1 天前
Notepad++插件开发实战指南
编辑器
QL.ql2 天前
vscode的wsl环境,ESP32驱动0.96寸oled屏幕
ide·vscode·编辑器
广州华锐视点2 天前
论郑和下西洋元素融入课件编辑器的意义与影响
编辑器