MacOS VSCode C++环境配置 发表于 2020-06-07 更新于 2025-01-28 分类于 环境配置 阅读次数: 本文字数: 1.6k 阅读时长 ≈ 1 分钟 MacOS系统下VSCode的C++环境配置,参考本文配置,VScode就可以跑C++代码啦 环境要求 软件: Xcode VSCode 插件: C/C++ Code Runner CodeLLDB 配置文件 c_cpp_properties.json 12345678910111213141516171819{ "configurations": [ { "name": "Mac", "includePath": [ "${workspaceFolder}/**" ], "defines": [], "macFrameworkPath": [ "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks" ], "compilerPath": "/usr/bin/clang", "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "clang-x64" } ], "version": 4} launch.json 12345678910111213141516{ // 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "lldb", "request": "launch", "name": "Debug", "program": "${fileDirname}/${fileBasenameNoExtension}.out", "args": [], "cwd": "${workspaceFolder}" } ]} tasks.json 12345678910111213141516171819202122{ "version": "2.0.0", "tasks": [ { "label": "Build with Clang", "type": "shell", "command": "clang++", "args": [ "${file}", "-std=c++11", "-o", "${fileDirname}/${fileBasenameNoExtension}.out", "-g", "--debug" ], "group": { "kind": "build", "isDefault": true } } ]}