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"
        }
    ]
}
相关推荐
AndreasEmil1 小时前
JavaSE - 继承
java·开发语言·ide·vscode·intellij-idea·idea
银迢迢9 小时前
idea控制台中文乱码采用好几种方法一直解决不了
java·ide·intellij-idea
好好沉淀10 小时前
IDEA 取消 Save Actions 自动删除未用导入(前端开发避坑)
java·ide·intellij-idea
添加shujuqudong1如果未回复11 小时前
深度探索:自动驾驶路径规划与避障功能实现——从运动学到动力学模型到决策规划算法的完整系列
ide
淡水瑜14 小时前
Visual Studio 实操
ide·visual studio
aduzhe17 小时前
vscode 自动化格式问题
ide·vscode·自动化
齐齐大魔王18 小时前
系统安装概述
编辑器·github
invicinble19 小时前
关于认识,和优化idea开发
java·ide·intellij-idea
剽悍一小兔20 小时前
openEuler开发工具链与IDE支持性能深度测试
ide
kkk_皮蛋20 小时前
从零开始:用 Android Studio 开发一个 AI 智能日记 App
android·ide·android studio