swehner / foos

Instant replay system for foosball table
GNU General Public License v3.0
169 stars 34 forks source link

Can't compile the video/player/player #54

Closed stevenb9 closed 7 years ago

stevenb9 commented 7 years ago

When running the provided command: pushd video/player; make && popd

I get following output: pi@raspberrypi:~/Desktop/foos-25cb27145af454929f0671ca26931ab79f8c2e02 $ pushd video/player; make && popd ~/Desktop/foos-25cb27145af454929f0671ca26931ab79f8c2e02/video/player ~/Desktop/foos-25cb27145af454929f0671ca26931ab79f8c2e02 ~/Desktop/foos-25cb27145af454929f0671ca26931ab79f8c2e02 cc -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g3 -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -Wno-psabi -L/opt/vc/lib/ -lGLESv2 -lEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt -lm -L/opt/vc/src/hello_pi/libs/ilclient -L/opt/vc/src/hello_pi/libs/vgfont -o player video.o -lilclient /usr/bin/ld: cannot find -lGLESv2 /usr/bin/ld: cannot find -lEGL collect2: error: ld returned 1 exit status Makefile:12: recipe for target 'player' failed make: *** [player] Error 1

I'm running a 2017-09-07 raspbian image I have updated and installed libav-tools sox cec-utils

swehner commented 7 years ago

Hi,

libEGL.so should be located in /opt/vc/lib included in the raspberryPi firmware: https://github.com/raspberrypi/firmware/tree/master/opt/vc/lib Seems like there have been some updates recently in those libs: https://github.com/RPi-Distro/repo/issues/80

They should be included in the libraspberrypi0 package - check if it's installed, update it if required and see if it includes this file: "dpkg -L libraspberrypi0"

If it's not there can you also please attach an output of "ls of /opt/vc/libs"?

stevenb9 commented 7 years ago

I checked if libraspberrypi0 is installed, it was and is up-to-date

output for dpkg -L libraspberrypi0:

pi@raspberrypi:~/Desktop/foos/video/player $ dpkg -L libraspberrypi0
/.
/etc
/etc/ld.so.conf.d
/etc/ld.so.conf.d/00-vmcs.conf
/lib
/lib/udev
/lib/udev/rules.d
/lib/udev/rules.d/10-local-rpi.rules
/opt
/opt/vc
/opt/vc/lib
/opt/vc/lib/libbcm_host.so
/opt/vc/lib/libbrcmEGL.so
/opt/vc/lib/libbrcmGLESv2.so
/opt/vc/lib/libbrcmOpenVG.so
/opt/vc/lib/libbrcmWFC.so
/opt/vc/lib/libcontainers.so
/opt/vc/lib/libdebug_sym.so
/opt/vc/lib/libdtovl.so
/opt/vc/lib/libelftoolchain.so
/opt/vc/lib/libmmal.so
/opt/vc/lib/libmmal_components.so
/opt/vc/lib/libmmal_core.so
/opt/vc/lib/libmmal_util.so
/opt/vc/lib/libmmal_vc_client.so
/opt/vc/lib/libopenmaxil.so
/opt/vc/lib/libvchiq_arm.so
/opt/vc/lib/libvcos.so
/opt/vc/lib/libvcsm.so
/opt/vc/lib/plugins
/opt/vc/lib/plugins/plugins
/opt/vc/lib/plugins/plugins/reader_asf.so
/opt/vc/lib/plugins/plugins/reader_avi.so
/opt/vc/lib/plugins/plugins/reader_binary.so
/opt/vc/lib/plugins/plugins/reader_flv.so
/opt/vc/lib/plugins/plugins/reader_metadata_id3.so
/opt/vc/lib/plugins/plugins/reader_mkv.so
/opt/vc/lib/plugins/plugins/reader_mp4.so
/opt/vc/lib/plugins/plugins/reader_mpga.so
/opt/vc/lib/plugins/plugins/reader_ps.so
/opt/vc/lib/plugins/plugins/reader_qsynth.so
/opt/vc/lib/plugins/plugins/reader_raw_video.so
/opt/vc/lib/plugins/plugins/reader_rcv.so
/opt/vc/lib/plugins/plugins/reader_rtp.so
/opt/vc/lib/plugins/plugins/reader_rtsp.so
/opt/vc/lib/plugins/plugins/reader_rv9.so
/opt/vc/lib/plugins/plugins/reader_simple.so
/opt/vc/lib/plugins/plugins/reader_wav.so
/opt/vc/lib/plugins/plugins/writer_asf.so
/opt/vc/lib/plugins/plugins/writer_avi.so
/opt/vc/lib/plugins/plugins/writer_binary.so
/opt/vc/lib/plugins/plugins/writer_dummy.so
/opt/vc/lib/plugins/plugins/writer_mp4.so
/opt/vc/lib/plugins/plugins/writer_raw_video.so
/opt/vc/lib/plugins/plugins/writer_simple.so
/usr
/usr/share
/usr/share/doc
/usr/share/doc/libraspberrypi0
/usr/share/doc/libraspberrypi0/README
/usr/share/doc/libraspberrypi0/changelog.Debian.gz
/usr/share/doc/libraspberrypi0/copyright

Output for ls /opt/vc/lib

pi@raspberrypi:/opt/vc/lib $ ls
libbcm_host.so    libdebug_sym_static.a  libmmal_components.so  libvchiq_arm.so
libbrcmEGL.so     libdtovl.so            libmmal_core.so        libvchostif.a
libbrcmGLESv2.so  libEGL_static.a        libmmal.so             libvcilcs.a
libbrcmOpenVG.so  libelftoolchain.so     libmmal_util.so        libvcos.so
libbrcmWFC.so     libGLESv2_static.a     libmmal_vc_client.so   libvcsm.so
libcontainers.so  libkhrn_client.a       libopenmaxil.so        plugins
libdebug_sym.so   libkhrn_static.a       libvcfiled_check.a

However the file is not present

swehner commented 7 years ago

Ok - thanks for the data. It looks like in the newer version of the distro they renamed the libraries. I'll have to take a look and see how we can autodetect the right name of the library. For now, the easiest way to fix it for you might be creating symlinks with the old names pointing to the new files. sudo ln -s /opt/vc/lib/libbcrmEGL.so /opt/vc/lib/libEGL.so (possibly required for more libraries)

stevenb9 commented 7 years ago

Ok did this but they still dont seem to be found sudo ln -s /opt/vc/lib/libbcrmEGL.so /opt/vc/lib/libEGL.so sudo ln -s /opt/vc/lib/libbcrmGLESv2.so /opt/vc/lib/libGLESv2.so

symlinks dont seem to work, however i downloaded and copied the two files from the reaspberry pi repo and placed them in /opt/vc/lib. Now i was able to compile the player but when running check, i get this error

* Test Replays - press Y to test N to skip
Running camera...
./check: line 122:  3107 Terminated              video/run-camera.sh
video/player/player: error while loading shared libraries: libGLESv2.so: cannot open shared object file: No such file or directory
swehner commented 7 years ago

Weird that the symlinks didn't work - have you checked if they point to the correct files? Maybe you need to reload the ldconfig cache: $ sudo ldconfig

Tomorrow I'll take a look and see if there's some way of choosing the correct libraries while compiling

swehner commented 7 years ago

I've added support to use either the new files or the old ones - please reopen this ticket if you still have troubles compiling the player!