https://github.com/jrcichra/vscode_c_project
Files needed to get started writing C in VSCode
https://github.com/jrcichra/vscode_c_project
c tutorial vscode
Last synced: 7 months ago
JSON representation
Files needed to get started writing C in VSCode
- Host: GitHub
- URL: https://github.com/jrcichra/vscode_c_project
- Owner: jrcichra
- Created: 2019-02-06T18:27:29.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-16T14:28:38.000Z (almost 7 years ago)
- Last Synced: 2025-08-21T12:58:21.855Z (8 months ago)
- Topics: c, tutorial, vscode
- Language: C
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# How to setup C compilation and debugging in VSCode (Windows)
I love VSCode, but C doesn't work out of the box. I did some googling online but didn't come up with a perfect solution in one place. This guide is by no means perfect, but it should help you get up and running, coding and debugging c programs
## Installation
If you haven't already, install [Visual Studio Code](https://code.visualstudio.com/) for your platform.
Download [MinGW](https://osdn.net/projects/mingw/releases/) with the blue ```mingw-get-setup.exe``` button.
Install MinGW in the default location of C:\MinGW. When MinGW asks you what packages you want to install, do the base C compiler and C++ compiler. In theory, this will work for both, however, as of the current moment, I've only written C code in VSCode.

Once this is done, close the MinGW installer.
Open up VSCode and navigate to a new project folder.
Inside this folder, make a .vscode directory.
Inside that .vscode directly, download and place the .json files into the .vscode directory.

Inside tasks.json, the "command" is what will be run as part of compilation. Change the gcc line to match your needs. In this case, I have main.c sent to gcc.

Add gcc to your system environment variable path. You can specify the exact path inside the tasks.json, but if you ever want to do gcc in cmd, this makes it soooo much nicer.




RESTART VSCODE!!! Otherwise, it won't recognize the updated PATH variable
This "should" be everything you need to get it working. I'll be making the process simpler as we go but this is revision 1. Open up an issue if I missed anything.
Justin