BACK TO PORTFOLIO
// Developer Tooling

C Compiler Setup

An automated setup tool and guide configuring VS Code with TDM-GCC for seamless C/C++ compilation on Windows systems via automated PowerShell build tasks.

CC++PowerShellVS CodeWindowsTDM-GCC

AUTOMATED POWERSHELL SETUP COMMAND

Run this command in an elevated Windows PowerShell terminal to configure TDM-GCC compiler paths and VS Code environment rules automatically:

irm "https://raw.githubusercontent.com/shuaib-code/c-compiler-setup/main/script/setup.ps1" | iex

// MANUAL SETUP ARCHITECTURE

1. TDM-GCC COMPILER ENGINE

Downloads and validates TDM-GCC 64-bit (`gcc`, `g++`, `gdb`, `mingw32-make`), enforcing explicit environment variable entry under system `PATH` (`C:\TDM-GCC-64\bin`).

2. ISOLATED BUILD OUTPUTS

Configures workspace task pipelines to output compiled binaries (`.exe`) into dedicated local `/build` folders, preserving repository cleanliness.

VS CODE BUILD TASK CONFIGURATION (.vscode/tasks.json)

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Compile & Run C (TDM-GCC)",
      "type": "shell",
      "command": "powershell",
      "args": [
        "-Command",
        "New-Item -ItemType Directory -Force -Path build;",
        "gcc '${file}' -o build\\${fileBasenameNoExtension}.exe;",
        "if ($?) { .\\build\\${fileBasenameNoExtension}.exe }"
      ],
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "presentation": {
        "echo": true,
        "reveal": "always",
        "focus": false,
        "panel": "shared",
        "showReuseMessage": false,
        "clear": false
      },
      "problemMatcher": ["$gcc"]
    }
  ]
}