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"
        }
    ]
}
相关推荐
小李不困还能学2 小时前
VSCode_RemoteSSH_一直卡在下载服务器_解决教程
服务器·ide·vscode
caoliaoerweima2 小时前
草料二维码小程序上线活码编辑器:手机上也能编辑活码了
智能手机·小程序·编辑器·草料二维码
慧都产品智能化1 天前
Qt 表格升级攻略:复用已有编辑器,减少重复开发
c++·qt·编辑器·qt6.3
独隅1 天前
WebStorm macOS 安装部署与高效调优完全指南
ide·macos·webstorm
独隅2 天前
WebStorm macOS 安装调优与实战效能全景
ide·macos·webstorm
DFT计算杂谈2 天前
可DIY布里渊区图像绘制编辑器
人工智能·机器学习·语言模型·矩阵·编辑器
独隅2 天前
WebStorm Linux 版安装实战与核心效能展示
linux·ide·webstorm
lzj_pxxw3 天前
STM32移植FreeRTOS(Cmake+CubeMX)
vscode·stm32·嵌入式硬件
独隅3 天前
WebStorm 在 Linux 环境下的实战安装与高效开发指南
linux·ide·webstorm
modelmd3 天前
离线安装与使用 vscode Remote SSH插件
ide·vscode·ssh