C GUI Calculator

A GUI-based calculator developed in C using GTK.


Project maintained by rafisarkar0128 Hosted on GitHub Pages — Theme by mattgraham

🧮 C GUI Calculator – System Requirements

This document outlines the requirements, dependencies, and tools needed to build and run the C GUI Calculator project, a cross-platform calculator built using C and GTK+ 3.

🎯 Overview

The C GUI Calculator requires:

📋 System Requirements

Minimum Hardware

Supported Operating Systems

📦 Core Dependencies

Component Version Purpose Status
gcc 7.0+ GNU Compiler Collection for compiling C source code ✅ Required
pkg-config 0.29+ Manages compiler/linker flags for libraries ✅ Required
GTK+ 3 3.22+ GUI toolkit for creating the calculator interface ✅ Required
GLib 2.56+ Low-level system library (included with GTK+) ✅ Required
make 4.0+ Build automation tool 📋 Optional
git 2.0+ Version control system 📋 Optional

🖥️ Platform-Specific Installation Instructions

Linux

Ubuntu/Debian/Mint

sudo apt update && sudo apt upgrade -y
sudo apt install gcc pkg-config libgtk-3-dev build-essential

Fedora/RHEL/CentOS

# Fedora/RHEL 8+
sudo dnf update -y
sudo dnf groupinstall "Development Tools" -y
sudo dnf install gcc pkgconf-pkg-config gtk3-devel

# CentOS/RHEL 7
sudo yum groupinstall "Development Tools"
sudo yum install gcc pkgconfig gtk3-devel

Arch/Manjaro

sudo pacman -Syu
sudo pacman -S base-devel gtk3 pkg-config

Windows

  1. Download and install MSYS2 from msys2.org
  2. Open the MSYS2 MinGW 64-bit terminal
  3. Run:
pacman -Syu
pacman -S base-devel mingw-w64-x86_64-gcc mingw-w64-x86_64-pkg-config mingw-w64-x86_64-gtk3

Important: Always use the MSYS2 MinGW 64-bit terminal, not the default MSYS2 terminal.

Alternative Methods

macOS

  1. Install Homebrew if not present:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install required packages:
xcode-select --install
brew install gcc pkg-config gtk+3
brew install --cask xquartz
  1. Log out and back in (or restart) after installing XQuartz
  2. Launch XQuartz before running the calculator

MacPorts (Alternative)

sudo port install gcc12 pkgconfig gtk3
sudo port select --set gcc mp-gcc12

🧪 Verification Steps

After installation, verify your environment:

# Check compiler
gcc --version                    # Should show GCC 7.0+

# Check pkg-config
pkg-config --version             # Should show 0.29+

# Check GTK+ 3
pkg-config --exists gtk+-3.0 && echo "✅ GTK+ 3 found" || echo "❌ GTK+ 3 missing"
pkg-config --modversion gtk+-3.0 # Should show 3.22+

# Test compilation
echo '#include <gtk/gtk.h>\nint main(){return 0;}' > test_gtk.c
gcc test_gtk.c $(pkg-config --cflags --libs gtk+-3.0) && echo "✅ GTK+ compilation works"
rm test_gtk.c a.out 2>/dev/null

⚠️ Common Issues & Solutions

Issue Solution
“Package gtk+-3.0 was not found” Install GTK+ development packages for your OS
“pkg-config: command not found” Install pkg-config package for your OS
GTK+ app doesn’t display on macOS Install and launch XQuartz (X11)
Wrong MSYS2 environment on Windows Use MinGW64 terminal, verify prompt shows “MINGW64” not “MSYS”

📘 Notes & Resources

For Beginners

Platform-Specific

Documentation & Learning Resources


✅ Next Steps

  1. Install the requirements above
  2. Follow the Getting Started Guide for detailed setup
  3. Compile and run the calculator
  4. Read the README for project overview and features

Need Help?