Home > Development Tools > VSCode > Can vscode compile c?

Can vscode compile c?

青灯夜游
Release: 2019-12-23 14:57:45
Original
7862 people have browsed it

Can vscode compile c?

vscode (Visual Studio Code) is a lightweight and powerful code editor that supports Windows, OS X and Linux. It has built-in support for JavaScript, TypeScript and Node.js, and has a rich plug-in ecosystem. You can install plug-ins to support other languages ​​such as C/C, C#, Python, and PHP.

The vscode editor supports writing in multiple languages ​​and file formats. As of September 2019, it has supported the following 37 languages ​​or files: F#, HandleBars, Markdown, Python, Jade, PHP, Haxe, Ruby , Sass, Rust, PowerShell, Groovy, R, Makefile, HTML, JSON, TypeScript, Batch, Visual Basic, Swift, Less, SQL, XML, Lua, Go, C, Ini, Razor, Clojure, C#, Objective-C, CSS, JavaScript, Perl, Coffee Script, Java, Dockerfile.

VScode configures the C language running environment

First of all, install VScode. Just go to the official website to download the installation package and install it. I won’t go into details here. Then, install the plug-in extension:

Search for C/C in the extension store on the left and install the official Microsoft plug-in

Can vscode compile c?

Can vscode compile c?

##Then install mingw-w64 and install the corresponding version on your computer, but now it is generally 64-bit.

Download link is here, but when I installed its MinGW-W64-install.exe file, I had a problem that it could not be downloaded, so it is recommended to directly download the compressed package and decompress it (as shown in the figure) ):

Can vscode compile c?

After downloading, just unzip it to the location you want. The next step is to configure the environment variables:

Right-click on My Computer-> ;Properties->Advanced System Settings->Environment Variables->Find Path in the system variables and click Edit:

Can vscode compile c?##Change to the directory you unzipped, and then open it In the command line cmd window, enter gcc -v to test whether the configuration is successful.

Open VScode, create a new folder under the project file you want to write in C language, named .vscode, then create a new C language file in your project directory, and write some test code ( Mine is test.c):

Can vscode compile c?
Click the bug-like button, then click the small gear icon of the settings, select C (GDB), and then let You choose another one, now choose the first one. After clicking, VScode will automatically generate two files for you, launch.json and tasks.json. At this time, the environment is configured, and CTRL F5 can compile and run the C program. .

Related recommendations:

vscode introductory tutorial

The above is the detailed content of Can vscode compile c?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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