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"
        }
    ]
}
相关推荐
我也有在努力22 分钟前
禁用 idea 屏幕阅读器功能 idea support screen readers
java·ide·intellij-idea
静若繁花_jingjing7 小时前
IDEA下载
java·ide·intellij-idea
影魅周影14 小时前
解决mac端pycharm执行allure命令报错:returned non-zero exit status 127
ide·macos·pycharm
ivy1598683771517 小时前
JM20329是一款高性能、低功耗的USB桥接芯片,实现串行接口(如SATA、IDE)与USB接口之间的数据转换。
c语言·开发语言·ide·嵌入式硬件·eureka·音视频·视频编解码
abiao198117 小时前
如何在 VSCode 中创建 Vue 项目
ide·vue.js·vscode
应用市场18 小时前
ARM编译器深度解析:从Keil到VSCode的STM32开发之
arm开发·vscode·stm32
WYS@不忘初心1 天前
在Eclipse IDE for Embedded C/C++ Developers软件中定义的宏,编译C源文件时编译器无法找到宏定义!
java·ide·eclipse
未来之窗软件服务1 天前
自建开发工具IDE(五)数据库预览——东方仙盟炼气期
数据库·ide·仙盟创梦ide·东方仙盟
初遇你时动了情1 天前
flutter vscode 终端无法使用fvm 版本切换、项目运行
ide·vscode·flutter
xxxxxue1 天前
VS Code 隐藏顶部标题栏中间的文字
vscode·隐藏·标题栏