Skip to content

Instantly share code, notes, and snippets.

@doccaico
Created October 18, 2020 12:43
Show Gist options
  • Select an option

  • Save doccaico/9ffc116cf6fd14ea859d071dc9c1d342 to your computer and use it in GitHub Desktop.

Select an option

Save doccaico/9ffc116cf6fd14ea859d071dc9c1d342 to your computer and use it in GitHub Desktop.
How to use raylib on Linux

Download railib 3.0.0

$ curl -LJO https://github.com/raysan5/raylib/releases/download/3.0.0/raylib-3.0.0-Linux-amd64.tar.gz

Install to ~/local/raylib3.0.0

$ tar zxvf raylib-3.0.0-Linux-amd64.tar.gz 
$ cd raylib-3.0.0-Linux-amd64
$ mkdir ~/local/raylib3.0.0
$ cp -r include ~/local/raylib3.0.0/
$ cp -r lib ~/local/raylib3.0.0/

Run the sample program

$ curl -O https://raw.githubusercontent.com/raysan5/raylib/3.0.0/examples/core/core_2d_camera.c

# Do not insert spaces between the `-Wl` and `-rpath` options.
# CORRECT: `-Wl,-rpath=` `-Wl,--rpath=`
# BAD: `-Wl ,-rpath=` `-Wl, -rpath=` `-Wl , -rpath=`
$ gcc -I$HOME/local/raylib3.0.0/include -L$HOME/local/raylib3.0.0/lib -Wl,-rpath=$HOME/local/raylib3.0.0/lib core_2d_camera.c -lraylib
$ ./a.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment