Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi4: fatal error: bcm_host.h: No such file or directory #9727

Open
ZedeN1 opened this issue Nov 15, 2019 · 5 comments
Open

Raspberry Pi4: fatal error: bcm_host.h: No such file or directory #9727

ZedeN1 opened this issue Nov 15, 2019 · 5 comments
Labels
platform: rpi4 prs welcome Pull Requests are welcome

Comments

@ZedeN1
Copy link

ZedeN1 commented Nov 15, 2019

Description

Fatal error when compiling on Raspbian running on Raspberry Pi 4 4Gb.

Expected behavior

Compiles successfully

Actual behavior

CC gfx/drivers/dispmanx_gfx.c
gfx/drivers/dispmanx_gfx.c:17:10: fatal error: bcm_host.h: No such file or directory
#include <bcm_host.h>
^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:213: obj-unix/release/gfx/drivers/dispmanx_gfx.o] Error 1
make: *** Waiting for unfinished jobs....

./configure output available on PasteBin
make -j4 output available on PasteBin

Steps to reproduce the bug

  1. git clone https://github.com/libretro/RetroArch.git
  2. sudo apt-get install build-essential libxkbcommon-dev zlib1g-dev libfreetype6-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libavcodec-dev libsdl2-dev libsdl-image1.2-dev libxml2-dev yasm libavformat-dev libavdevice-dev libswresample-dev libavresample-dev libswscale-dev libv4l-dev libgl*-mesa-dev
  3. CFLAGS='-mfpu=neon' ./configure --enable-alsa --enable-udev --enable-floathard --enable-neon --enable-dispmanx --disable-opengl1 --disable-videocore --enable-opengles --enable-opengles3
  4. make -j4

Bisect Results

./configure output available on PasteBin
make -j4 output available on PasteBin

Version/Commit

You can find this information under Information/System Information

Environment information

  • OS: Raspbian on Raspberry Pi 4 4Gb. Linux raspberrypi 4.19.81-v7l+ Retroarch-Wii #1276 SMP Fri Nov 1 14:23:48 GMT 2019 armv7l GNU/Linux]
  • Compiler: gcc (Raspbian 8.3.0-6+rpi1) 8.3.0

Solution to get further but to a different error:

Add -I/opt/vc/include to CFLAGS:
CFLAGS='-mfpu=neon -I/opt/vc/include' ./configure --enable-alsa --enable-udev --enable-floathard --enable-neon --enable-dispmanx --disable-opengl1 --disable-videocore --enable-opengles --enable-opengles3

GIves a different error:

CC led/drivers/led_rpi.c
LD retroarch
/usr/bin/ld: obj-unix/release/gfx/drivers/dispmanx_gfx.o: undefined reference to symbol 'vc_dispmanx_display_close'
/usr/bin/ld: //opt/vc/lib/libbcm_host.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:208: retroarch] Error 1
@hizzlekizzle
Copy link
Contributor

@ZedeN1
Copy link
Author

ZedeN1 commented Nov 15, 2019

Have you tried the solution from this post? https://raspberrypi.stackexchange.com/questions/36121/fatal-error-bcm-host-h-no-such-file-or-directory-compilation-terminated

Yes I have, didn't work. running rpi-update didn't work either.

I managed to get further in the compile process by adding -I/opt/vc/include to CFLAGS but the compile still dies with error:

CC led/drivers/led_rpi.c
LD retroarch
/usr/bin/ld: obj-unix/release/gfx/drivers/dispmanx_gfx.o: undefined reference to symbol 'vc_dispmanx_display_close'
/usr/bin/ld: //opt/vc/lib/libbcm_host.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:208: retroarch] Error 1

@ZedeN1
Copy link
Author

ZedeN1 commented Nov 15, 2019

I was able to compile without dispmanx:

CFLAGS='-mfpu=neon' ./configure --enable-alsa --enable-udev --enable-floathard --enable-neon --disable-opengl1 --disable-videocore --enable-opengles --enable-opengles3 --disable-dispmanx

Anyone know why dispmanx is giving me issues?

@asavah
Copy link
Contributor

asavah commented Nov 17, 2019

Pi4 does not support or use dispmanx and proprietary (legacy) firmware based GL* drivers (those from /opt/vc).
For pi4 standard opensource mesa drivers should be used over drm/kms, x11 or wayland.
raspberrypi/firmware#1171 (comment)

@zoltanvb
Copy link
Contributor

Configure scripts should nowadays handle RPi4 without extra options, guide also available: https://docs.libretro.com/guides/rpi/
I believe this one can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: rpi4 prs welcome Pull Requests are welcome
Projects
None yet
Development

No branches or pull requests

5 participants