vscode编译调试sln工程

使用msvc工具链

vscode配置调用visual studio的编译和调试环境_vscode用vs-CSDN博客

将vscode打造无敌的IDE(14) tasks.json和launch.json配置详解,随心所欲添加自动化任务_tasks.json详解-CSDN博客

通过命令行使用 Microsoft C++ 工具集 | Microsoft Learn

编译task.json

html 复制代码
{
    "version": "2.0.0",
	"windows": {
		"options": {
		  "shell": {
			"executable": "cmd.exe",
			"args": [
			  "/C",
			  // The path to VsDevCmd.bat depends on the version of Visual Studio you have installed.
			// 仿制"Developer Command Prompt for VS 2019.lnk"
			  // "\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/Tools/VsDevCmd.bat\"",
			  // cmd> vcvarsall.bat --help
			  "\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvarsall.bat\" x64",
			  "&&"
			]
		  }
		}
	  },
    "tasks": [
        {
            "label": "Build Solution",
            "type": "shell",
            "command": "msbuild",
            "args": [
                "/t:Build",
                "/p:Configuration=Debug",
                "Project.sln"
            ],
            "group": "build",
            "presentation": {
                "reveal": "always",
                "panel": "new"
            }
        }
    ]
}

调试的launch,json

html 复制代码
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "C++ Launch",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${workspaceFolder}/Debug/Placement.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "visualizerFile": "${workspaceFolder}/.vscode/visualizers.json",
            "visualStudio": "Path to your MSVC installation"
        }
    ]
}
相关推荐
SpiderPex8 小时前
Vibe Coding 开发流程心得:从入门到规范化的踩坑记录
vscode·编辑器·ai编程·开发流程·vibe coding
MR.欻16 小时前
ZLMediaKit 源码分析(四):RTP/RTCP 协议栈实现分析
c++·人工智能·vscode·ffmpeg·音视频
晚风吹红霞17 小时前
Vim编辑器从入门到熟练 —— 三种模式与常用命令详解
linux·编辑器·vim
SWAGGY..18 小时前
Linux系统编程:(十一)进程状态&&Linux中的僵尸状态
linux·服务器·编辑器·vim
青山如墨雨如画19 小时前
【Claude】Win11系统VSCode下的Claude使用方法
vscode·aigc·claude·vibe coding·authropic
青山如墨雨如画19 小时前
【Claude】Win11电脑下VSCode环境中Claude+Deepseek的报错及解决方法记录日志
vscode·aigc·claude·authropic
key_3_feng19 小时前
VSCode 分屏实战,同时对话 Claude Code 与 Copilot 提升多任务处理效率
vscode·claude code·多 agent 协作,开发效率
是烨笙啊21 小时前
AI编程:项目管理
ide·人工智能·ai编程
czy87874751 天前
vscode编译make命令要修改stm32cubemx生成的STM32F103XX_FLASH.ld文件
ide·vscode·stm32