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"
        }
    ]
}
相关推荐
C+-C资深大佬13 小时前
在PyCharm中创建虚拟环境的具体步骤是什么?
ide·python·pycharm
guslegend16 小时前
第2节:AI编辑器底层技术全景导览
人工智能·编辑器
小铁-Android17 小时前
Visual Studio Code创建Flutter项目时包名组织名更改
vscode·flutter
Sss_Ass17 小时前
CodeBuddy IDE(腾讯云代码助手)介绍及下载安装
ide·云计算·腾讯云
花伤情犹在19 小时前
2026 AI Agent 工具全景:执行层、编排层与 IDE 层的分工与选型
ide·人工智能
小宋102119 小时前
Mina Meeting Assistant 新手极速上手指南
ide·macos·ai·xcode·mina
jack@london19 小时前
eclipse启动tomcat6时报错OutOfMemoryError: PermGen space
java·ide·eclipse
超梦dasgg20 小时前
IDEA(IntelliJ IDEA)超详细基础使用教程
java·ide·intellij-idea
2501_9151063220 小时前
iOS开发工具有哪些?iOS 开发每个阶段的实用工具
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
OliverH-yishuihan21 小时前
【保姆级教程】Win11 下从零部署 Claude Code:本地环境配置 + VSCode 可视化界面全流程指南
ide·vscode·编辑器