Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>C/C++ Compile RunNew to Visual Studio Code? Get it now.
C/C++ Compile Run

C/C++ Compile Run

danielpinto8zz6

|
4,780,479 installs
| (59) | Free
Compile & Run single c/c++ files easly
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Logo

C/C++ Compile Run extension

Buy Me A Coffee Support via PayPal

Visual Studio Marketplace Version Visual Studio Marketplace Downloads Visual Studio Marketplace Rating Open VSX Version Open VSX Downloads Open VSX Rating

An extension running on Visual Studio Code to Compile, Run & Debug single c/c++ files easily

Extension

Features

Compile, Run & Debug C/C++ opened file directly from the command palette, by pressing 'f6', 'f7', 'f5', or by using status bar/menu icons.

Requirements

  • If you are on linux you must install gcc (see instructions)
  • If you are on window you must install tdm-gcc (see instructions)
  • If you are on mac os you must install clang/gcc (see instructions)

How to use

Make sure you have .c or .cpp file open. Press "F6", this will compile and run the file using default arguments in settings. If you press "F7", this will use the arguments you specify for the program. You can also debug by pressing "F5". Or you can use the status bar/menu items.

If you want to register gcc/g++ path manually, you can set it under settings. You can also set to save file before compiling.

Configurations

Key Description
c-cpp-compile-run.c-compiler The C compiler path (e.g: /usr/bin/gcc or C:\TDM-GCC-64\bin\gcc.exe)
c-cpp-compile-run.cpp-compiler The Cpp compiler path (e.g: /usr/bin/g++ C:\TDM-GCC-64\bin\gcc.exe)
c-cpp-compile-run.save-before-compile Whether should save the file before compiling
c-cpp-compile-run.c-flags The C flags: e.g. -Wall. default: -Wall -Wextra -g3
c-cpp-compile-run.c-linker-flags The C linker flags: e.g. -lm
c-cpp-compile-run.cpp-flags The Cpp flags: e.g. -Wall. default: -Wall -Wextra -g3
c-cpp-compile-run.cpp-linker-flags The Cpp linker flags: e.g. -lm
c-cpp-compile-run.run-args The run arguments
c-cpp-compile-run.run-in-external-terminal Whether should run in an external terminal
c-cpp-compile-run.should-show-notifications Whether should show notifications
c-cpp-compile-run.output-location Custom output location for the compiled file
c-cpp-compile-run.custom-run-prefix Prefix command before run (e.g: valgrind ./foobar)

Keybindings

Linux Windows Mac Description
f6 f6 cmd+r Compiles and runs the file
crtl+6 ctrl+6 cmd+6 Compiles and runs the file
f8 f8 cmd+y Compiles and run the file in external console
f7 f7 cmd+t Compiles and run the file specifying custom arguments and flags
f5 f5 cmd+5 Debugs the file (includes compile)

Release Notes

Refer to CHANGELOG

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