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"
        }
    ]
}
相关推荐
心平气和量大福大7 小时前
android studio(AS)工具-调试-统计总行数
android·ide·android studio
时间的情敌11 小时前
几款常用的编程AI工具
vscode
山峰哥12 小时前
造价算量系统SQL优化,慢查询从9秒压到35毫秒‌
大数据·数据库·sql·编辑器·深度优先
捷瑞电子工坊13 小时前
VSCode的配置和一些报错问题
vscode·ubuntu·c/c++·编译报错·开发环境配置·初学者教程·json配置
孙小l懒_keep_update1 天前
【VSCODE中的Codex 打不开(页面空白,一直 Loading)】
vscode
-To be number.wan1 天前
编译原理第三章:编译器是怎么“认字“的?——词法分析全解析
学习·编辑器
gzkuijing1 天前
MDI1PRD23B7‑EQ|Novanta IMS一体化RS-485/422步进电机参数、选型要点与典型应用
人工智能·机器学习·编辑器
面包狗AI4S1 天前
Codex/ChatGPT 反复 Reconnecting(正在重新连接) 5/5 的最简修复方法
人工智能·vscode·chatgpt
与自己和解7411 天前
使用ssh实现 VScode 直连 ubuntu
vscode·ubuntu·ssh
捷瑞电子工坊2 天前
Ubuntu 下安装 VSCode 和 gcc 的简单步骤
vscode·ubuntu·代码编辑器·安装教程·gcc·deb·snap