I looking for a way to do simple graphics on a raspberry PI. I have both a zero and 3B i been messing with.
I used buildroot to create a real fast boot time linux system for pi.
Im able to run qt5 graphical examples so i think i have opengl installed right with buildroot.
I came across raylib and it appears to be perfect for what i need to do.
I have compile raylib examples for on both windows and ubuntu (vmware)
What im having trouble understand how can i compile something for raspberry pi from either windows or ubuntu
I have a cross compiler on windows (arm-linux-gnueabihf-gcc) i have compiled simple hello world programs and ran them on the PI.
But when it comes to anything thing using libraries i dont know how it get something to work.
If i could compile one of the raylib example and run it on the pi i would be very happy.
if someone is able to push me into the right direction i would be very happy.
Thank you
Re: Compile raylib example for raspberry PI
Be careful there as custom buildroots frequently have trouble getting accelerated graphics working. Run glxinfo and check the output if you're getting Broadcom V3D and not softpipe (CPU rendering).gezzuzz wrote:Thu Sep 05, 2019 8:46 pmIm able to run qt5 graphical examples so i think i have opengl installed right with buildroot.
raylib is a CMake project. You can cross-compile it like so:I have a cross compiler on windows (arm-linux-gnueabihf-gcc) i have compiled simple hello world programs and ran them on the PI.
...
If i could compile one of the raylib example and run it on the pi i would be very happy.
Code: Select all
git clone https://github.com/raysan5/raylib.git && cd raylib
mkdir build; cd build
cmake .. -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ \
-DCMAKE_INSTALL_PREFIX=path/to/destination/raylib
make && make install
You have to install those dependency libraries, e.g. for OpenGL:But when it comes to anything thing using libraries i dont know how it get something to work.
Code: Select all
sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install libgl1-mesa-dev:armhf
Re: Compile raylib example for raspberry PI
I guess I should have listed the steps I have done so far:
1. git clone https://github.com/raysan5/raylib.git && cd raylib - done
2. mkdir build; cd build - done - created build in the raylib dir
3. cmake .. -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ \
-DCMAKE_INSTALL_PREFIX=path/to/destination/raylib - failed - bash-cmake command not found
I thought i had gotten further, but this is it for this try!
David
1. git clone https://github.com/raysan5/raylib.git && cd raylib - done
2. mkdir build; cd build - done - created build in the raylib dir
3. cmake .. -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ \
-DCMAKE_INSTALL_PREFIX=path/to/destination/raylib - failed - bash-cmake command not found
I thought i had gotten further, but this is it for this try!
David
Re: Compile raylib example for raspberry PI
update - turns out I had not installed cmake. Once that was done, raylib successfully installed. I ran make on the examples, but when I try to run them in a terminal window, a terminal window appears for a blink of an eye and goes away. Clicking on just Execute does nothing I can see. I am trying to run all by using OpenGL ES 2.o without X11 support.
I have tried to add a path, in Geany's make file to point to raylib/src, but any function from ralib I try gives a compile error of "undefined reference" to what ever function I call.
Any ideas?
David
I have tried to add a path, in Geany's make file to point to raylib/src, but any function from ralib I try gives a compile error of "undefined reference" to what ever function I call.
Any ideas?
David
Re: Compile raylib example for raspberry PI
Opps - my two posts were meant for another thread! Sorry.
David
David
Re: Compile raylib example for raspberry PI
/path/to/destination/raylib - if you just copy and paste the above command then this or whatever else you put it to is your directory