Skip to content

Installation

This guide will help you install CacaoLang on your system.

Prerequisites

Required

  • C++ Compiler (g++ with C++17 support)
  • pkg-config

Optional (for GUI support)

  • GTK4 development libraries

Platform-Specific Installation

# Install compiler and build tools
sudo apt update
sudo apt install build-essential pkg-config

# Install GTK4 (optional, for GUI support)
sudo apt install libgtk-4-dev
# Install compiler and build tools
sudo dnf install gcc-c++ pkg-config

# Install GTK4 (optional, for GUI support)
sudo dnf install gtk4-devel
# Install Xcode Command Line Tools
xcode-select --install

# Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install GTK4 (optional, for GUI support)
brew install gtk4 pkg-config
# Install MSYS2 from https://www.msys2.org/

# Open MSYS2 terminal and run:
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-pkg-config

# Install GTK4 (optional, for GUI support)
pacman -S mingw-w64-x86_64-gtk4

Building CacaoLang

Clone the Repository

git clone https://git.gay/coffeeshop-development/cacaolang.git
cd cacaolang

Compile the Interpreter

With GUI Support

g++ -o choco main.cpp choco_gui.cpp \
    $(pkg-config --cflags --libs gtk4) -std=c++17

Without GUI Support

g++ -o choco main.cpp -DCHOCO_NO_GUI -std=c++17

Install System-Wide (Optional)

# Linux/macOS
sudo cp choco /usr/local/bin/

# Or add to your PATH
export PATH="$PATH:/path/to/cacaolang"

Verify Installation

Test that CacaoLang is installed correctly:

./choco

You should see the REPL welcome message:

======================================
  CacaoLang 1.2.5 - Coco Loco
  REPL (mochalx v1.4.9)
  Type 'exit' or 'quit' to leave
======================================

choco:1>

Check GUI Support

To verify GUI support is available:

pkg-config --exists gtk4 && echo "GTK4 is installed" || echo "GTK4 not found"

Troubleshooting

GTK4 Not Found

If you get GTK4-related errors:

  1. Verify GTK4 is installed:

    pkg-config --modversion gtk4
    

  2. Check pkg-config can find GTK4:

    pkg-config --cflags --libs gtk4
    

  3. Compile without GUI support using -DCHOCO_NO_GUI

Compilation Errors

If you encounter C++ compilation errors:

  • Ensure you have C++17 support: g++ --version (need GCC 7+ or Clang 5+)
  • Check that all source files are present
  • Try cleaning and rebuilding

Permission Denied

If you can't execute the choco binary:

chmod +x choco

Next Steps

Now that CacaoLang is installed, proceed to: