VSCode installation tutorial and configure C/C++ environment

Table of contents

1. Download and installation of VSCode

1.VSCode download

2. Installation of VSCode

2. Initialization configuration

3. Configure the environment required for C/C++

4. Configure the VSCode compilation environment


1. Download and installation of VSCode

1.VSCode download

Government:Download Visual Studio Code - Mac, Linux, Windows

Choose the version to download according to your system, I choose windows

2. Installation of VSCode

Run the .exe file you just downloaded

Click to agree to the agreement and proceed to the next step

Customize the storage path. It is best not to put it on the C drive. Find a drive with a large capacity.

Next step

The default here is fine, add it to the start menu, click Next

Check the box in the picture and click Next

Note:

1: Create a shortcut on the desktop: check

2: Add VSCode to the right-click menu and support opening files: check

3: Add VSCode to the right-click menu and support opening directories: check

4: After checking, many text formats will be changed to be opened with VSCode, such as .txt files: uncheck

5: Add to PATH (environment variable), automatically added, no manual configuration required: check

Confirm the information you just configured and click Install

Waiting for installation

Click Finish

After clicking Finish, you will automatically enter this interface.

Configure Chinese interface

Click the last button in the left column

Enter Chinese in the search box, the first one is Simplified Chinese, click install

If you want to use English, you don’t have to change it.

After installation, this thing pops up in the lower right corner

Click restart

Then after reopening, it will be the Chinese interface.

2. Initialization configuration

Let’s get to know the interface first

The left column from top to bottom is: Resource Manager, Search Function, Source Code Management, Debug, and Install Plugins

The start interface allows initialization settings

[Theme Settings] I choose dark colors, which are better for the eyes.

[Sync to other devices] Click and select

[Just one shortcut to access everything] Click and select

Select [Rich support for all languages]

Select [Open your code]

Select an empty folder and open it

Click to trust

VSCode is now installed

3. Configure the environment required for C/C++

Configure the local compiler MinGW

MinGW: It can be understood as a software that contains a variety of compilation environments that can be installed freely.

Download link:Download directly after opening

Select installation path

【This step is very important! ! ! ! ! 】

Install dependencies

After clicking Continue or open the MinGW Installation Manager (on the desktop), -
Check the compiler software, and Mark will be ok once checked

After the installation is complete, open the D:\software\vscode-MinGW\bin path

It’s the compilers that are installed.

When this operation is not performed, there is only one exe file in the bin, which is the manager of the desktop.

Add the path [D:\software\vscode-MinGW\bin] to the environment variable

Suddenly openMy phone->Attributes ->High-grade system installation->Environmental change

Copy this path to the path in the environment variable and it will be ok

Type gcc -v on the command line

Check if the installation is successful

Jiang Zi is ok~~~

4. Configure the VSCode compilation environment

Install C/C++ plug-in

Has code prompt function

Guess you like

Origin blog.csdn.net/qq_40647372/article/details/135032201