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 gcc2. Verification
bash
gcc --version3. Basic Compilation
bash
gcc program.c -o program
./program4. 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