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"
        }
    ]
}
相关推荐
BD_Marathon1 小时前
【JavaWeb】IDEA运行并部署JavaWeb项目原理
java·ide·intellij-idea
Better Bench2 小时前
Ubuntu aarch64\arm64系统安装vscode
linux·vscode·ubuntu
x10n92 小时前
OceanBase 参数对比工具 附源码
数据库·vscode·oceanbase·腾讯云ai代码助手
我是菜鸟0713号3 小时前
VSCode配置Qt6开发教程
ide·vscode·编辑器
Jovin Giogic4 小时前
简明教程:记录 Ubuntu系统命令行安装TexLive,配置vscode
linux·vscode·ubuntu·latex·texlive
小蜜蜂嗡嗡6 小时前
Android studio配置忽略文件
android·ide·android studio
lanhuazui106 小时前
VScode中函数和变量跳转定义配置文件设置
vscode·编辑器
ZC·Shou6 小时前
Rust 之二 各组件工具的源码、构建、配置、使用(二)
开发语言·ide·rust·工具·命令·clippy·rustfmt
求学中--9 小时前
YOLOv8安装部署全流程指南(PyCharm实战版)
ide·yolo·pycharm
oioihoii9 小时前
VSCode CMake Tools 功能解析、流程与最佳实践介绍
ide·vscode·xhtml