Home > Development Tools > VSCode > body text

How to build a C language development environment with vscode

王林
Release: 2019-12-17 10:24:02
Original
12067 people have browsed it

How to build a C language development environment with vscode

Install c/c extension

How to build a C language development environment with vscode

Install compilation environment mingw-w64

Download address: http://www.mingw-w64.org/doku.php/download

Configure environment variables, taking WIN10 as an example, this computer-Properties-Advanced system settings-Environment variables-System variables- path-Add a line E:\mingw-w64\mingw32\bin\ (the address of the compilation environment you installed)

How to build a C language development environment with vscode

After cmd configuration:

How to build a C language development environment with vscode

Configuring vscode

1) After opening the folder, create a new hello.c for testing:

How to build a C language development environment with vscode

2) Press F5 to proceed Debugging, the following logo appears, and select

How to build a C language development environment with vscode

##3) Select launch.json and a launch.json startup configuration file will be generated in the working directory: and modify accordingly The file

The picture below is after modification:

How to build a C language development environment with vscode

4) Go back to hello.c and press F5 to debug, you need to select the configuration task

How to build a C language development environment with vscode

How to build a C language development environment with vscode

How to build a C language development environment with vscode##5) Configure c_cpp_properties.json

How to build a C language development environment with vscode5. Others

Once and for all: Because VS needs to be configured separately for each folder, it is recommended to put the .vscode folder at the top level of your commonly used folders, so that you don’t need to repeat the configuration. There is no need for a set of configurations for each new cpp file. These configurations can be used in all subfolders and files within the folder you configured.

Note: There are Chinese characters in the printf statement, and garbled characters are displayed during debugging. You can perform the following operations.

Recommended related articles and tutorials:

vscode tutorial

The above is the detailed content of How to build a C language development environment with vscode. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!