Mac 上搭建C++ 环境可参考Vscode 官网的教程:
Configure VS Code for Clang/LLVM on macOS
遇到的问题
在安装Debug 模式时,在控制台遇到以下报错:
Unable to start debugging. Unexpected LLDB output from command "-exec-run". process exited with status -1
解决方式:
c++ - VSCode LLDB on MacOS error when starting debugging session - Stack Overflow
将launch.json 中type字段改成 lldb
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "clang++ - Build and debug active file",
"type": "lldb",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"preLaunchTask": "clang++ build active file"
}
]
}
|