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"
        }
    ]
}
相关推荐
猿小猴子5 小时前
主流 Agent 之 「Zed」和 「ZCode」 介绍
ide·ai·agent·zed·zhipu·ade·zcode
ue星空8 小时前
【Godot】更换编辑器外观主题
编辑器·游戏引擎·godot
没事学点编程小知识9 小时前
免费的在线EPUB编辑器:E-Ink
编辑器
浪客川10 小时前
使用 IDEA 生成API文档
java·ide·intellij-idea
SMF191912 小时前
【PyCharm】让 PyCharm 使用 .venv 虚拟环境
ide·python·pycharm
User_芊芊君子13 小时前
STT + LLM + TTS:用一条流水线搓了个中英双向翻译助手
ide·macos·xcode
菜哥万岁万岁万万岁1 天前
Visual Studio 2022 社区版下载
ide·visual studio
iCxhust1 天前
8088单板机VScode集成开发环境使用方法
ide·笔记·vscode·编辑器·微机原理·8088单板机
如何原谅奋力过但无声1 天前
现代化Python工具:uv、Ruff、Pyright、Rich(只讲重点版)
vscode·python·uv
来日方长。。。。long1 天前
Hermes Agent橙皮书共读|第三篇:保姆级实战部署|本地/VPS从零搭建Hermes
ide·git·hermes