Skip to content

C Installation

Setting up a C development environment.

1. GCC Installation

Windows

  • Download MinGW from mingw.org
  • Or use MSYS2: pacman -S mingw-w64-gcc

Linux

bash
# Ubuntu/Debian
sudo apt-get install build-essential

# CentOS/RHEL
sudo yum groupinstall "Development Tools"

macOS

bash
# Install Xcode Command Line Tools
xcode-select --install

# Or use Homebrew
brew install gcc

2. Verification

bash
gcc --version

3. Basic Compilation

bash
gcc program.c -o program
./program

4. IDE Options

  • VS Code with C/C++ extension
  • Code::Blocks
  • Dev-C++
  • CLion (paid)
  • Visual Studio (Windows)

5. Makefiles

makefile
CC = gcc
CFLAGS = -Wall -g

program: program.c
    $(CC) $(CFLAGS) program.c -o program

clean:
    rm -f program

Content is for learning and research only.