DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
Cupertino desk4 min

How to Set Up a C Compiler and IDE on Windows, Linux, or macOS

A practical platform-by-platform guide to choosing a C IDE or editor, installing a compiler toolchain, configuring it, and checking that it works.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To write and run C programs, you need a C compiler and a way to edit code; to debug programs, you also need a debugger. If you use Visual Studio Code (VS Code), install those tools separately—the C/C++ extension adds editing and configuration features but does not include a compiler or debugger. A full IDE can integrate more of the workflow. Choose the setup that matches your operating system and any course or project requirements.

Choose an IDE or editor and compiler

A code editor is where you write code; a compiler turns that code into a program. A debugger helps you inspect and step through a program while it runs. These may come together in an integrated development environment (IDE), or you may install and connect them separately.

As an Amazon Associate I earn from qualifying purchases.

VS Code is an editor that relies on command-line tools for compiling and debugging. Its C/C++ extension does not supply those tools; see Microsoft’s C/C++ for Visual Studio Code documentation. Visual Studio is a full IDE option, while its C++ toolset can also be installed without the full IDE. Microsoft describes support for its own toolset and third-party toolsets such as CMake with Clang or MinGW in its Visual Studio C++ overview.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Choose a full IDE if you want project setup and build/debug controls integrated in one application.
  • Choose VS Code if you prefer a lighter editor and are comfortable installing a compiler and debugger separately, then configuring the editor to use them.
  • Check requirements first: a class, employer, or existing project may require a particular compiler or build setup.

JetBrains describes a development toolchain as typically including a compiler, debugger, and build system. Its CLion Linux setup guide offers examples of installing a compiler on apt-based systems.

Set up C on Windows

For VS Code, the documented Windows routes include Microsoft’s MSVC toolset or MinGW-w64, which provides GCC and GDB in Microsoft’s tutorial. Choose one based on project requirements and the toolchain you intend to use; the configuration steps differ.

Option 1: Microsoft’s MSVC toolchain

  1. Follow Microsoft’s VS Code MSVC walkthrough to install and configure the compiler and debugger.
  2. When prompted to install Visual Studio, select the Desktop development with C++ workload. Microsoft notes that you can install this workload without installing the full Visual Studio IDE.
  3. Follow the walkthrough to configure VS Code’s build task and debugger for MSVC.

Option 2: MinGW-w64 with GCC

  1. Follow Microsoft’s MinGW-w64 VS Code tutorial to install the toolchain.
  2. Add the toolchain’s bin directory to your user PATH. The tutorial’s example, C:msys64ucrt64bin, applies only if you used that documented default installation layout; use the actual directory on your computer.
  3. Open a new Command Prompt so it picks up the updated PATH, then run the checks below.
  4. Configure VS Code’s build task and debugger using the tutorial’s steps.

Check that GCC, G++, and GDB are available by running these commands in the fresh Command Prompt:

gcc --version
g++ --version
gdb --version

If a command is not recognized, confirm that the correct MinGW-w64 bin directory is on PATH, then open another new terminal. The version checks confirm that the executables are discoverable; they do not by themselves configure VS Code to build or debug a project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set up C on Linux

GCC is a common Linux compiler, but installation commands vary by distribution. Use your distribution’s package manager and instructions rather than assuming one command works everywhere. On apt-based systems, JetBrains gives these examples for installing either GCC or Clang:

sudo apt update
sudo apt install gcc

For Clang instead, the example installation command is:

sudo apt install clang

After installation, open a terminal and check that the compiler is available:

gcc --version

If you installed Clang, check it with clang --version. Then configure your editor or IDE to use the installed compiler and debugger. In VS Code, the C/C++ extension provides configuration support but still relies on the tools installed on your system.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Set up C on macOS

Microsoft describes Clang tools with Xcode as a common macOS route. Install or confirm the Xcode command-line toolchain, then use Microsoft’s VS Code macOS Clang tutorial to configure Clang and a debugger. The tutorial also covers selecting a compiler for the default build task and saving C/C++ configuration in .vscode/c_cpp_properties.json.

Best Value

In a terminal, check that Clang is discoverable:

clang --version

If the command is unavailable, confirm that the Xcode command-line toolchain is installed and follow the tutorial for your setup. The tutorial’s configuration steps connect VS Code to the compiler and debugger; installing an editor extension alone does not install them.

Verify the complete setup

A successful version check means the terminal can find the compiler, but a working development setup also needs the editor or IDE to invoke the right tools. After following the platform-specific configuration steps, create a small C project and use the editor’s build and debug controls to confirm that the configured compiler and debugger work together. If the editor reports that it cannot find a compiler, first check the executable name and installation, then confirm PATH or the configured toolchain path and reopen the terminal or editor as appropriate.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.