Learning C++: VSCode configures C++ development environment

foreword

Compared with Visual Studio, VSCode is more lightweight and can be used across platforms. When testing some small algorithms, VSCodethe combination C/C++Extensionis very small, so this article mainly summarizes how to configure the C++ development environment on VSCode.

There is no difference between the C++ development environment configuration and the Python environment configuration, and both follow the following rules:

  1. install interpreter
  2. install plugin
  3. Configure the interpreter address in the plugin

The installation details are detailed below.

Compiler installation and configuration

Windows environment

download

Install MinGW in the Win environment , here select the online installer, as shown in the following figure:

Please add a picture description

Install:

  1. Select the appropriate version, the windows 64-bit system can be selected as follows:
    Please add a picture description

  2. Make sure that the installation path has no 空格and 中文characters, so the path is as follows:
    Please add a picture description

  3. Waiting for online download and installation
    Please add a picture description

Configure environment variables

  1. As shown below
    insert image description here

Installation and configuration of C++ plug-ins

Install

As shown below:
Please add a picture description

configuration

  1. Configure the plug-in Compiler Pathas a C++ compiler environment variable, as follows:
    Please add a picture description
  2. Configure the plugin IntelliSence modeas gcc-x64follows:
    Please add a picture description

test

The test results are as follows:
insert image description here

Summarize

It can be seen that the development environment configuration of C++ is no different from that of Python, and both follow the following rules:

  1. install interpreter
  2. install plugin
  3. Configure the interpreter address in the plugin

Much the same.

References

[1] VSCode configures C/C++ environment

Guess you like

Origin blog.csdn.net/xuyangcao123/article/details/122699179
Recommended