Skip to content

Instantly share code, notes, and snippets.

@last-ent
Last active April 10, 2020 22:54
Show Gist options
  • Save last-ent/46fe96447a7ead7dbe3e9daf714222c3 to your computer and use it in GitHub Desktop.
Save last-ent/46fe96447a7ead7dbe3e9daf714222c3 to your computer and use it in GitHub Desktop.
How to configure RayLib with C for Layman

How to configure RayLib with C for Layman

  1. Clone repository git clone https://github.com/raysan5/raylib.git raylib && cd raylib/src
  2. Compile library to be dynamically linked make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED
  3. Install library sudo make install RAYLIB_LIBTYPE=SHARED # Dynamic shared version.
  4. Set CPATH export CPATH=/usr/local/lib:/usr/local/include (Required by compiler to find the shared library)
  5. Compile Source Code clang -lraylib -o hello hello.c (Using Basic Window example)
  6. Set LD_LIBRARY_PATH LD_LIBRARY_PATH=$CPATH (Required by executable to find the shared library)
  7. Run executable ./hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment