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"
        }
    ]
}
相关推荐
小庞在加油3 小时前
从qmake到CMake+VSCode:Qt项目现代化迁移与AI提效实战指南
vscode·qt·ai·ai工具
utf8mb4安全女神5 小时前
HTML网页【vscode】【Linux】
ide·vscode·编辑器
百度搜知知学社5 小时前
一键装裱照片,相框APP内置滤镜与贴纸编辑器
android·编辑器·滤镜·图片编辑·贴纸·相框
S-码农7 小时前
vscode 通过 SSH 远程控制 Ubuntu
vscode·ubuntu·ssh
zyplayer-doc8 小时前
继飞书之后,又一款知识库推出了开源 Agent-Native CLI 工具
人工智能·pdf·编辑器·飞书·开源软件
伶俜669 小时前
鸿蒙原生应用实战(一):从零开发一个短视频编辑器 App
编辑器·音视频·harmonyos
山峰哥9 小时前
从全表扫描到覆盖索引:我是怎么干掉慢查询的
数据库·sql·oracle·性能优化·编辑器·深度优先
_Athie9 小时前
【开发工具】自动创建项目文件夹结构
unity·编辑器
A.说学逗唱的Coke9 小时前
【大模型专题】AI Copilot 完整实践指南:VSCode + GitHub Copilot Agent 模式全攻略
人工智能·vscode·copilot