electronstudio / raylib-python-cffi

Python CFFI bindings for Raylib
http://electronstudio.github.io/raylib-python-cffi
Eclipse Public License 2.0
152 stars 29 forks source link

[make error] Raspberry Pi Build and Compile guide for noobies please? #101

Closed TheConceptBoy closed 1 year ago

TheConceptBoy commented 1 year ago

This guide here: https://github.com/electronstudio/raylib-python-cffi/blob/master/RPI.rst

Provides a near little step by step guide on cloning, compiling and building the library. This resulted in the followin error:

[  0%] Building C object raylib/CMakeFiles/raylib.dir/rcore.c.o
In file included from /home/lonesometrail/raylib/src/rcore.c:121:
/home/lonesometrail/raylib/src/rlgl.h:801:18: fatal error: GLES2/gl2.h: No such file or directory
  801 |         #include <GLES2/gl2.h>          // OpenGL ES 2.0 library
      |                  ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [raylib/CMakeFiles/raylib.dir/build.make:82: raylib/CMakeFiles/raylib.dir/rcore.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:392: raylib/CMakeFiles/raylib.dir/all] Error 2
make: *** [Makefile:182: all] Error 2

This seems to be related to OpenGL drivers. So I look down into the documentation and it does mention the following:

Attention!

The Broadcom proprietary Open GL ES 2.0 drivers (installed by Raspbian into /opt/vc and compiled in Raylib with PLATFORM_RPI) do not work with Bullseye and have not been tested with the bindings. They will probably require additional linker arguments to be added to build.py. Suggest you use PLATFORM_DRM instead.

The only problem is that, where the initial setup was very direct in the step by step of what you need to do to build and compile for raspberry pi. This adnedum thows some terminology, some keywords and newbies can go figure what any of this means or where to toss in this flag.

Could someone add an addendum of where to go and what to do to compensate for the build error?

electronstudio commented 1 year ago

Those instructions are a little out of date; I have updated them.

'Noobies' shouldn't need to compile Raylib, they should just use the binary wheel. If you do need to compile Raylib and have issues dong it then those issues should be directed to Raylib, not Raylib-Python-CFFI. I think the official docs are at https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi . They also have a Discord where you can ask for help.

The stuff about the broadcom drivers is irrelevent if you are following preceeding instructions, because you aren't using those drivers. It's a warning to people who do want to use them. Again the terminology is nothing to do with Raylib-Python-CFFI really. It is confusing but that's because Raylib on Raspberry Pi is confusing and the driver situation is quite a rabbit hole.

Your error is caused by missing OpenGL library, so I would try something like:

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

Unfortunately I don't have a Raspberry Pi anymore so I can't fix anything Pi-specific until someone buys me one.