下载vs code 创建空文件夹 随意创建一个hello.cpp文件 在调试中添加launch.json
{
"version" : "0.2.0" ,
"configurations" : [
{
"name" : "(lldb) 启动" ,
"type" : "cppdbg" ,
"request" : "launch" ,
"program" : "${workspaceFolder}/a.out" ,
"args" : [ ] ,
"stopAtEntry" : false ,
"cwd" : "${fileDirname}" ,
"environment" : [ ] ,
"externalConsole" : false ,
"MIMode" : "lldb"
}
]
}
win+sift+p 打开设置,选择c/c++编辑配置(json)生成文件c_cpp_properties.json
{
"configurations" : [
{
"name" : "Mac" ,
"includePath" : [
"${workspaceFolder}/**"
] ,
"defines" : [ ] ,
"macFrameworkPath" : [
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
] ,
"compilerPath" : "/usr/bin/clang" ,
"cStandard" : "c17" ,
"cppStandard" : "c++98" ,
"intelliSenseMode" : "macos-clang-arm64"
}
] ,
"version" : 4
}
win+sift+p 打开设置,选择任务配置任务,中的从模版创建选outher生成文件tasks.json
{
"version" : "2.0.0" ,
"tasks" : [
{
"label" : "echo" ,
"type" : "shell" ,
"command" : "echo Hello"
}
]
}