The mqtt library is heavily-templated, and takes a lot of memory to compile (>1G) which does not work on RPI. To compile the player for RPI, use cross compiltion from linux machine with enough memory:
sudo apt install crossbuild-essential-armhf
sudo apt install sshfs
SSHFS here will mount the raspberry pi (its root - /) to the local filesystem
sudo sshfs ${RPI_USERNAME}@${RPI_IP}:/ $MOUNT_POINT
example: sudo sshfs pi@10.0.0.200:/ /mnt/rpi
if for some reason there's an issue with the mount - do: ls -l /mnt
if you see a lot of '?????????' on /mnt/rpi then run: fusermount -u /mnt/rpi
and run the sshfs command again.
- clone the repository to a directory on RPI file system (using the mount, or directly).
- then
cd
to the project directory on the mount fs, for example:cd /mnt/rpi/home/pi/dev/wavplayeralsa
- create the cmake build directory:
mkdir build && cd build
- run camke with relevant toolchain camke file:
cmake -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE ..
where $TOOLCHAIN_FILE should point to thetoolchain-armv7l.cmake
file from cross-compile directory in the project repo. note that this file assumes rpi mounting point is at/mnt/rpi
. make -j2
the generated project.- the executable is now in the build directory on the rpi