Raylib on Linux

I’m having issues with compilation in the first axe-game exercise. Following the instructions for a Linux build there doesn’t seem to be any mention of installing the Raylib library. I went to the Raylib Github (Working on GNU Linux · raysan5/raylib Wiki · GitHub) and cloned the repo, and provided the absolute path in my .cpp file for the header.
When I compile using RunBuildTask… I get the following error, as it seems no matter where I clone the library to it cannot be found!

I have tried cloning to
/usr/local/lib/
/home/linuxbrew/.linuxbrew/lib/
and also my home directory, but nothing is working for me.
I am on Ubuntu 20.04.5 LTS.

Fixed the problem. For anyone else who may be struggling getting things to work on a Debian based system, try these steps.

sudo apt install build-essential git
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev

Then from your home directory:

git clone https://github.com/raysan5/raylib.git raylib
cd raylib/src/
make PLATFORM=PLATFORM_DESKTOP
sudo make install 

After this I had no issues. You can find more details here.
The problems I was having (besides not knowing exactly where to install the library) was in part due to me trying to install the dynamic shared library, as the wiki says it is what is often used on Linux. Simply going with the static version solves everything.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

I don’t know how well this works with Debian, but following the MacOS instructions for installing Raylib via homebrew also works for Linux.

Privacy & Terms