█
LastWrite
  • > Curriculum
  • > Pricing
  • > For Educators
  • > About
  • > Contact
Log InGet Started

Questions, concerns, bug reports, or suggestions? We read every message, write to us at [email protected].

More ways to reach us →
LastWrite

Structured computer science lessons for aspiring developers and security professionals.

[email protected]

(201) 785-7951

Mon–Fri, 9 AM–5 PM EST

Learn

  • Curriculum
  • Pricing

Company

  • About
  • For Educators & Schools
  • Contact Us

Legal

  • Terms of Service
  • Privacy Policy
© 2026 LastWrite. All rights reserved.
Curriculum/Programming Languages/C/C Dev Environment Setup
30 minBeginner

C Dev Environment Setup

After this lesson, you will be able to: Set up a C dev environment: GCC, clang, VS Code with the C/C++ extension.

C dev environments vary by OS. Get the basics working once.

Prerequisites:Why C in 2026

Compiler choices

GCC: GNU C compiler. Default on most Linux. clang: LLVM-based; default on macOS. Slightly nicer error messages. MSVC: Microsoft Visual C++. Windows-native; usually via Visual Studio. For learning: GCC or clang. They're interchangeable for most code.

Install + compile

Per OS.

bash
# macOS
xcode-select --install # provides clang + make
clang --version
# Linux (Ubuntu/Debian)
sudo apt install build-essential gdb valgrind
gcc --version
# Windows: either WSL (recommended) or install MinGW-w64 / MSYS2
# WSL: enable Windows Subsystem for Linux + install Ubuntu → use Linux steps
# Compile + run
gcc hello.c -o hello -Wall -Wextra -std=c17 -g
./hello
# Flags:
# -Wall -Wextra enable warnings (always use)
# -std=c17 use the C17 standard
# -g include debug symbols (for gdb / lldb)
# -O2 optimize (use for release builds)

VS Code setup

Best free C IDE for most people.

tsx
# Install VS Code
# Install extensions:
# - C/C++ (Microsoft)
# - CodeLLDB (debugger), for clang
# - clangd (better intellisense than ms-vscode.cpptools)
# .vscode/tasks.json, one-key compile
# .vscode/launch.json, one-key debug

Common mistakes only experienced C devs avoid

Compiling without -Wall -Wextra. Hidden bugs ship. Skipping -g during dev. Can't use gdb effectively. Hardcoding paths instead of using Makefiles or CMake. Mixing standards (-std=c89 vs c17). Pick one per project.

Quick Check

Why always compile with -Wall -Wextra?

Pick the senior answer.

Sign in and purchase access to unlock this lesson.

Sign in to purchase
←Why C in 2026
Back to C
C Fundamentals→