Use Vscode for C + + development under Mac

Source: Internet
Author: User

1. Installation

Download the Vscode installation package for Mac system from Vscode official website, then unzip the ZIP installation package to the desktop when the download is complete.

2, plug-in installation

Implement C/CPP Code Auto-completion, function jump.

After opening the Vscode, press the key combination "?? X ", open the extension, enter" C + + ", install the" C + + "," C + + Clang Command Adapter ", after the installation is complete, restart Vscode let the plugin take effect.

3, "Hello World"

After restarting, press the combo key again "?? X ", after opening the extension, the interface such as:

  

  

(1) Click "Open Folder",---> "New File",

(2) Press the combination key "?? Q ", such as Operation

Add "Launch.json" files, such as:

  

Modify "Launch.json", such as:

(3) Compiling

Press the key combination "?? B ", such as Operation

  

  

  

Generate the "Tasks.json" file:

Modify the "Tasks.json" file, such as:

  

(4) Implementation

Press the combo key again "?? B ", compile the CPP file, after the completion of the compilation," F5 "debugging execution, such as:

  

For the purpose and meaning of the parameters in the ". JSON" file, see "How does Visual Studio code write run C, C + +?" ”

Use Vscode for C + + development under Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.