使用msvc工具鏈
vscode配置調(diào)用visual studio的編譯和調(diào)試環(huán)境_vscode用vs-CSDN博客
將vscode打造無敵的IDE(14) tasks.json和launch.json配置詳解,隨心所欲添加自動化任務(wù)_tasks.json詳解-CSDN博客?
通過命令行使用 Microsoft C++ 工具集 | Microsoft Learn?
編譯task.json文章來源:http://www.zghlxwxcb.cn/news/detail-775318.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"
}
}
]
}
調(diào)試的launch,json文章來源地址http://www.zghlxwxcb.cn/news/detail-775318.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"
}
]
}
到了這里,關(guān)于vscode編譯調(diào)試sln工程的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!