Overview Version History Q & A Rating & Review
VS Code cCompiler Extension
A simple extension that helps you Compile C projects in VS Code. It auto-generates a minimal Makefile (or compiles on the fly), tracks local header dependencies, and runs your program—all with Two simple commands.
Install
Install using this link https://marketplace.visualstudio.com/items?itemName=DeepinderDhillon.cCompiler
or
Search C-Compile in VS Code Extensions
Features
Feature
What it does
Run
Compiles and runs the current .c
file. Uses Makefile if available.
Makefile generation
Creates a Makefile by finding all related .c
files from includes.
Run prompt
Fills in ./program
in the terminal so you can hit Enter or add args.
Custom settings
Change compiler, flags, and libraries in VS Code settings.
Safe overwrite
Asks before replacing an existing Makefile.
Terminal fallback
Opens terminal and reruns command if build fails in background.
How to Use
Open a .c
file in your editor.
Press F1
, Ctrl+Shift+P
, or type >
to open the command palette.
Type and run C: Generate Makefile & Compile
.
It will generate a Makefile (if one doesn’t exist), scan for dependencies, and compile the project.
Type and run C: Compile & Run
.
If Makefile exists, runs make; else compiles tracked .c files. Pre-fills ./program for quick run.
Customizing the Build
You can change the compiler or flags in the extension settings.
Method 1: VS Code Settings UI
Go to Settings → Extensions → cCompiler and set:
CC
– the compiler (e.g. gcc
)
CFLAGS
– compiler flags
LIBS
– linker libraries
Method 2: Editing settings.json
Open the Command Palette (Ctrl+Shift+P
)
Select Preferences: Open Settings (JSON)
Add the following:
{
"cCompiler.CC": "gcc",
"cCompiler.CFLAGS": ["-std=c11", "-Wall"],
"cCompiler.LIBS": ["-lm", "-lpthread"]
}
These settings will apply when generating a Makefile or compiling a file directly.
Requirements
VS Code version 1.99 or higher
GCC, Make installed and available in your system PATH
Contributing
Fork the repo
Create a new branch
Open a pull request with your changes
License
MIT