raylib: [build] Build failure in Raspberry PI Zero W

Issue description

I am trying to build raylib on my Raspberry Pi Zero W, I get build error on rcore.c as the following:

pi@raspberrypi:~/raylib-master $ make
Scanning dependencies of target raylib
[  0%] Building C object raylib/CMakeFiles/raylib.dir/rcore.c.o
In file included from /usr/include/X11/Xlib.h:44,
                 from /usr/include/EGL/eglplatform.h:128,
                 from /usr/include/EGL/egl.h:39,
                 from /home/pi/raylib-master/src/rcore.c:254:
/usr/include/X11/X.h:100:13: error: conflicting types for ‘Font’
  100 | typedef XID Font;
      |             ^~~~
In file included from /home/pi/raylib-master/src/rcore.c:115:
/home/pi/raylib-master/src/raylib.h:296:3: note: previous declaration of ‘Font’ was here
  296 | } Font;
      |   ^~~~
/home/pi/raylib-master/src/rcore.c:355:9: error: unknown type name ‘EGL_DISPMANX_WINDOW_T’
  355 |         EGL_DISPMANX_WINDOW_T handle;       // Native window handle (graphic device)
      |         ^~~~~~~~~~~~~~~~~~~~~
/home/pi/raylib-master/src/rcore.c: In function ‘InitGraphicsDevice’:
/home/pi/raylib-master/src/rcore.c:4381:23: error: request for member ‘element’ in something not a structure or union
 4381 |     CORE.Window.handle.element = dispmanElement;
      |                       ^
/home/pi/raylib-master/src/rcore.c:4382:23: error: request for member ‘width’ in something not a structure or union
 4382 |     CORE.Window.handle.width = CORE.Window.render.width;
      |                       ^
/home/pi/raylib-master/src/rcore.c:4383:23: error: request for member ‘height’ in something not a structure or union
 4383 |     CORE.Window.handle.height = CORE.Window.render.height;
      |                       ^
/home/pi/raylib-master/src/rcore.c:4386:90: warning: passing argument 3 of ‘eglCreateWindowSurface’ makes integer from pointer without a cast [-Wint-conversion]
 4386 | Window.surface = eglCreateWindowSurface(CORE.Window.device, CORE.Window.config, &CORE.Window.handle, NULL);
      |                                                                                 ^~~~~~~~~~~~~~~~~~~
      |                                                                                 |
      |                                                                                 int *

In file included from /home/pi/raylib-master/src/rcore.c:254:
/usr/include/EGL/egl.h:155:109: note: expected ‘EGLNativeWindowType’ {aka ‘long unsigned int’} but argument is of type ‘int *’
  155 | Y eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
      |                                                             ~~~~~~~~~~~~~~~~~~~~^~~

make[2]: *** [raylib/CMakeFiles/raylib.dir/build.make:82: raylib/CMakeFiles/raylib.dir/rcore.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:374: raylib/CMakeFiles/raylib.dir/all] Error 2
make: *** [Makefile:182: all] Error 2

Environment

My linux platform:

pi@raspberrypi:~/raylib-master $ uname -a
Linux raspberrypi 5.10.63+ #1488 Thu Nov 18 16:14:04 GMT 2021 armv6l GNU/Linux

I configured cmake with the following command:

cmake . -DPLATFORM="Raspberry Pi"

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (5 by maintainers)

Most upvoted comments

I think we can close it. For the closing note here: My build problem is solved by using PLATFORM_DRM build option on RPI OS Bullseye.

@raysan5 May be another issue should be opened to deal with PLATFORM_RPI option on new RPI OS. I leave this one up to you 😉 Thanks.

Raspberry Pi Foundation have launched a legacy version of Raspberry Pi OS, which is based on Debian Buster. I tried this and it works fine on Raspberry Pi 3, building with PLATFORM_RPI compiles and runs perfectly in native mode! I suspect Pi Zero will also work although I haven’t tried it yet.

Raylib is fantastic software btw!