Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>C-CompileNew to Visual Studio Code? Get it now.
C-Compile

C-Compile

Deepinder Dhillon

|
76 installs
| (1) | Free
Compile C code, Run and generate Makefile
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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

  1. Open a .c file in your editor.
  2. Press F1, Ctrl+Shift+P, or type > to open the command palette.
  3. Type and run C: Generate Makefile & Compile.
  • It will generate a Makefile (if one doesn’t exist), scan for dependencies, and compile the project.
  1. 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

  1. Open the Command Palette (Ctrl+Shift+P)
  2. Select Preferences: Open Settings (JSON)
  3. 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

  1. Fork the repo
  2. Create a new branch
  3. Open a pull request with your changes

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft