Raylib is a nice compact and very portable multimedia library. It manage hardware acceleration and compatibilities problems.
We will see here how to build it (in may 2025).
Building it
git clone https://github.com/raysan5/raylib
cd raylib
mkdir build && cd build
curl -O raylib-5.5.tar.gz https://github.com/raysan5/raylib/archive/refs/tags/5.5.tar.gz
By default examples are build, but examples need rlight sub lib
raylib/examples/others/easings_testbed.c:20:10: fatal error: reasings.h: No such file or directory
[…]
raylib/examples/models/models_loading_vox.c:25:10: fatal error: rlights.h: No such file or directory
[…]
raylib/examples/others/embedded_files_loading.c:20:10: fatal error: resources/audio_data.h: No such file or directory
So first time it must be build without examples. cmake -LAH allow to found available cmake option in general and specific to the project.
cmake -LAH ..
In the output you can see all the options.
To build without examples:
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
make -j0
sudo make install
Then you can rebuild them with examples.