1, install MinGW

1, access sourceforge.net/projects/mi…

2. Cut out mingw64 after decompression and pay attention to the file address

Note: Configure the PATH environment variable

2. Install C/C++ extensions

1. Install C/C++ extensions in VS Code

Method one:

1, the link of the file. Vscode and needs to be compiled files with same level directory, and then according to the actual situation to modify in the file “D: / Hnist/Software/mingw64 / bin/g + +. Exe” address

Link: https://pan.baidu.com/s/1OspfzquIuIcv4U8fB3vYHQ extraction code: VScd copy after this paragraph open baidu cloud mobile phone App, operation more convenient

Method 2:

1. Configure IntelliSense

1. Press Ctrl+Shift+P to bring up the command panel, enter C/C++, and click Edit Configuration (UI) to enter the configuration

2. Select the compiler path and IntelliSense mode

Note: After the configuration is complete, a.vscode folder with the c_cpp_properties.json file is automatically generated

2. Compile and configure

1. Press Ctrl+Shift+P to bring up the command panel, enter Tasks, and select Edit Configuration (UI)

C/C++: g++. Exe build active file

Note: After the configuration is complete, a tasks.json file will appear in the.vscode folder

3. Debug the configuration

1, run, click to start debugging

Select C++(GDB/LLDB)

Note: after the configuration is complete, the.vscode folder will have the launch.json file

3, set Windows console open, default false built-in terminal open

4. The effect is shown in the figure

Note:.vscode files are reusable