Raylib and wiringPi

Hi, i am and italian student and i am working on a scholastic project. I am using a Raspberry Pi 3 B, for this project i am trying to use the library wiringPi (for controlling GPIO) and Raylib (for the graphical part of the game) but i honestly don't know how to compile a program using both libraries. Can you help me? Thanks

Comments

  • edited October 2016
    Hi Felpato! Welcome to the forum! :)

    To compile raylib for Raspberry Pi, follow the intructions: https://github.com/raysan5/raylib/wiki/Compile-for-Raspberry-Pi

    When you compile raylib, you will obtain libraylib.a

    You should also do a similar process to compile WiringPi library: http://wiringpi.com/download-and-install/

    Once you have both libraries compiled, you can code your program (using raylib and WiringPi) and you should link with those libraries and all the required dependencies:

    gcc -o your_game your_game.c -O2 -Wall -std=gnu99 -fgnu89-inline -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lbcm_host -lopenal -lwiringPi -DPLATFORM_RPI

    Make sure that all the libraries are available for the compiler, I mean, they are placed in the right paths.
  • Thanks for the help, it worked!
  • Hi Felpato! That's great! :D

    Could you share some sample code for other users? I think it could be interesting! :)
Sign In or Register to comment.