Mac environment VSCode configures C++ and writes Hello World

  1. Install VSCode, click theDownload link to download the Mac version of vscode.
  2. Install "C++ extension for VS Code", search for c++ in the extension (⇧⌘X), and installInsert image description here
  3. Ensure that CLANG is installed successfully. Enter clang --version in the mac terminal. If the installation is successful, relevant information will be printed. If it is not successful, enter "xcode-select --install" to install CLANG.
  4. Install the command to open VSCode from the command line.
    Open the Command Palette (Cmd+Shift+P), enter 'shell command', then select installation, then exit the Mac terminal and then enter the terminal, enter .code to open VSCode in the folder . The original text is as follows

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
Insert image description here
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. Write Hello World, refer directly tohttps://code.visualstudio.com/docs/languages/cpp

References to this article:

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

Guess you like

Origin blog.csdn.net/zcl369369/article/details/130424128