Skip to content

Compiling on Linux

Moros Smith edited this page May 5, 2024 · 6 revisions

Installation

Ubuntu 20.04 and distros based on Ubuntu 20.04

Update and install the compiler, related build tools, and libraries required to build PixelGameEngine applications.

sudo apt update

sudo apt install build-essential libglu1-mesa-dev libpng-dev

Arch Linux

Update and install the compiler, related build tools, and libraries required to build PixelGameEngine applications.

sudo pacman -Sy

sudo pacman -S gcc glibc libpng mesa

Fedora 34

Install development tools, libraries, and C++

sudo dnf groupinstall "Development Tools" "Development Libraries"
sudo dnf install gcc-c++ glew-devel glm-devel libpng-devel

More Linux Distributions

Placeholder for more instructions for more Linux Distributions

Building

g++ -o olcExampleProgram olcExampleProgram.cpp -lX11 -lGL -lpthread -lpng -lstdc++fs -std=c++17

Note for those using extensions and utilities

Certain extensions and utilities use C++20 features. If you use those with PGE, you'll need to compile with -std=c++20 instead.

Earlier versions of GCC

In GCC 7.5.0, and similarly early versions of GCC, you may need to add -DFORCE_EXPERIMENTAL_FS to your build command to avoid an error involving the missing filesystem header file. While this will get you up and running, it is preferred that you use a more up-to-date version of the GCC compiler system. Upgrade instructions vary between distributions and can be found elsewhere on the internet.

Run the example program

./olcExampleProgram

FAQ

Your frequently asked questions might appear here, one day!