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

Closed
ghost opened this issue Dec 26, 2019 · 3 comments
Closed

Raspberry Pi Error #984

ghost opened this issue Dec 26, 2019 · 3 comments

Comments

@ghost
Copy link

ghost 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
Copy link

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?

@farvardin
Copy link
Contributor

farvardin commented Aug 11, 2020

For building on raspberry pi (4), I had to install libglvnd-dev instead of libglu1-mesa-dev (as adviced by apt-get).
(I also had to install libasound2-dev but I just suppose it was missing from the readme)

Then I followed advice on #794 (comment) and added as the 2nd line in CMakeLists.txt:

link_directories(/opt/vc/lib)

and that's all. I've managed to compile tic80 and the linker no longer complained about lbcm_host (there is a bcm_host.h in /opt/vc/include/)

(note: I'm running raspbian 10)

@nesbox
Copy link
Owner

nesbox commented Nov 10, 2020

Dup of #1017

@nesbox nesbox closed this as completed Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants