mac环境VSCode 配置C++,并写Hello World

  1. 安装VSCode,点击下载链接,下载Mac版本的vscode。
  2. 安装“C++ extension for VS Code”,在扩展 (⇧⌘X)中搜索c++,并安装在这里插入图片描述
  3. 确保CLANG安装成功。在mac的终端下输入clang --version,如果安装成功会打印相关信息,未成功输入“xcode-select --install”安装CLANG。
  4. 安装从命令行打开VSCode的命令。
    打开Command Palette (Cmd+Shift+P),输入’shell command’,之后选择安装,之后退出Mac终端再进入终端,输入.code 就可以在该文件夹下打开VSCode了。原文如下

Launch VS Code. Open the Command Palette (Cmd+Shift+P) and type ‘shell command’ to find the Shell Command: Install ‘code’ command in PATH
command. macOS shell commands
在这里插入图片描述
Restart the terminal for the new $PATH value to take effect. You’ll be
able to type ‘code .’ in any folder to start editing files in that
folder.

  1. 编写Hello World,直接参考https://code.visualstudio.com/docs/languages/cpp

本文参考:

  • https://code.visualstudio.com/docs/cpp/config-clang-mac
  • https://code.visualstudio.com/docs/languages/cpp
  • https://code.visualstudio.com/docs/setup/mac

猜你喜欢

转载自blog.csdn.net/zcl369369/article/details/130424128