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
##Then install mingw-w64 and install the corresponding version on your computer, but now it is generally 64-bit. 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:##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):
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 tutorialThe above is the detailed content of Can vscode compile c?. For more information, please follow other related articles on the PHP Chinese website!