Introduction
This guide will set up a complete C/C++ development environment for building Kemena3D on Ubuntu Linux, covering the GCC compiler, OpenGL libraries, the Vulkan SDK, and the CMake build system.
Installing the GCC Compiler
The GNU Compiler Collection (GCC) is the standard C/C++ compiler on Linux. The build-essential meta‑package installs GCC, g++, make, and other essential tools.
sudo apt update
sudo apt install build-essential -yVerify the installation:
gcc --versionInstalling a Newer GCC Version (Optional)
If you need a more recent GCC version, add the ubuntu-toolchain-r/test PPA:
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update
sudo apt install gcc-14 g++-14 -y # replace 14 with desired versionInstalling OpenGL Development Libraries
OpenGL support on Ubuntu is provided by Mesa. Install the core development files:
sudo apt install libgl1-mesa-dev mesa-common-devInstalling the Vulkan SDK (optional)
Vulkan is a modern low‑overhead graphics API. The SDK is provided by LunarG.
Option A: Install via Ubuntu Package (easier, but may be outdated)
sudo apt install vulkan-sdkOption B: Install via the Official LunarG Tarball (recommended)
This gives you the most up‑to‑date SDK.
- Download the Linux tarball from LunarG's Vulkan SDK page.
- Extract it to a directory (e.g.,
~/VulkanSDK): - Set environment variables by adding these lines to your
~/.bashrc: - Reload your shell configuration:
Minimal Vulkan Loader (if you only need the basics)
sudo apt install libvulkan-dev vulkan-toolsInstalling CMake
CMake is a cross‑platform build system generator widely used for C/C++ projects. It simplifies dependency management and building.
Install from the Ubuntu Repository
The simplest method:
sudo apt update
sudo apt install cmake -yCheck the version:
cmake --versionNote: The repository version may be older. If you need a newer CMake, use the Snap package or the official installer.
Install a Newer Version via Snap
sudo snap install cmake --classicInstall the Official Binary (Alternative)
Download the latest .sh installer from cmake.org, then:
chmod +x cmake-*.sh
sudo ./cmake-*.sh --prefix=/usr/local --skip-licenseYou now have a complete development environment for graphics programming on Ubuntu, time to build Kemena3D!
