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 Pi Error #984

Open
RaspberyPye opened this issue Dec 26, 2019 · 1 comment
Open

Raspberry Pi Error #984

RaspberyPye opened this issue Dec 26, 2019 · 1 comment

Comments

@RaspberyPye
Copy link

@RaspberyPye RaspberyPye commented Dec 26, 2019

I am trying to build from sources and have reached the 'make' command, however i encounter an error:
/usr/bin/ld: cannot find -lbcm_host
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/player-sdl.dir/build.make:93: bin/player-sdl] Error 1
make[1]: *** [CMakeFiles/Makefile2:200: CMakeFiles/player-sdl.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I have found a similar error on this forum, but the solution was confusing. Here it is:
#794
I don't understand the solution, where would i put that code? I tried placing it on line 4, but got this error:
/usr/bin/ld: lib/libSDL2.a(SDL_dynapi.c.o): undefined reference to symbol 'dlopen@@GLIBC_2.4'
/usr/bin/ld: //lib/arm-linux-gnueabihf/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/player-sdl.dir/build.make:93: bin/player-sdl] Error 1
make[1]: *** [CMakeFiles/Makefile2:200: CMakeFiles/player-sdl.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I don't know what to do and i appreciate the help,
Love what you're doing with TIC-80, i just wish i could access it!
Thanks!

@oschettler

This comment has been minimized.

Copy link

@oschettler oschettler commented Jan 1, 2020

Hi RaspberyPye, I am trying the same (compiling on a RaspberryPi 4) and got the same error.
I have already installed the missing libraries in /opt/vc and pointed the linker to them, but the error persists. This is what I have tried:

sudo apt-get install --reinstall libraspberrypi0 libraspberrypi-dev libraspberrypi-doc libraspberrypi-bin

# There is a file /etc/ld.so.conf.d/00-vmcs.conf with the line "/opt/vc/lib"

sudo ldconfig -v # finds the library 

Still I get the error. The command that fails is

/usr/bin/c++    -rdynamic CMakeFiles/player-sdl.dir/src/player/sdl.c.o  -o bin/player-sdl lib/libtic80core.a lib/libSDL2.a lib/libSDL2main.a lib/liblua.a lib/liblpeg.a lib/libwren.a lib/libsquirrel.a lib/libgiflib.a -lm -ldl /usr/lib/arm-linux-gnueabihf/libsndio.so -ldbus-1 -libus-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -Wl,--no-undefined -Wl,-rpath,/opt/vc/lib -lbcm_host -pthread 

This command is in file CMakeFiles/player-sdl.dir/link.txt. I can run it with bash, even added -Wl,--verbose to see the linker output. It just doesn't find the library /opt/vc/lib/libbcm_host.so.
So, I replaced -lbcm_host.so with /opt/vc/lib/libbcm_host.so. This works. But then the next compilation step fails.

Editing CMakeFiles/tic80.dir/link.txt in the same way, I was able to link a working bin/tic80 executable.

However, how could I make -lbcm_host work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.