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"
    
}
相关推荐
智慧地球(AI·Earth)1 小时前
Codex配置问题解析:wire_api格式不匹配导致的“Reconnecting...”循环
开发语言·人工智能·vscode·codex·claude code
markvivv4 小时前
在 Kylin Linux Advanced Server for Kunpeng V10 上构建 VSCode 1.106
linux·vscode·kylin
zhangfeng11335 小时前
Kiro python环境的设置 中文语言包设置,通用vscode ,因为kiro是vscode基础上做的
开发语言·vscode·python
微醺的老虎6 小时前
【工具】vscode格式化json文件
ide·vscode·编辑器
乔宕一7 小时前
vscode 设置每次调试 powershell 脚本都使用临时的 powershell 终端
ide·vscode·编辑器
唐装鼠8 小时前
linux vscode解压版 AI账号无法登陆问题(浏览器无法打开vscode)
linux·运维·vscode
山峰哥9 小时前
数据库工程与SQL调优实战:从原理到案例的深度解析
java·数据库·sql·oracle·性能优化·编辑器
m0_466607709 小时前
IAR Embedded Workbench (EWARM) 项目中的关键文件
编辑器
gravity_w9 小时前
vscode配置SSH远程服务器
服务器·经验分享·vscode·ssh
阴暗扭曲实习生10 小时前
135编辑器字符效果:上标数字与特殊字体实现步骤
编辑器