• SoftwareC/C++
  • Missing shared libs when cross compiling using xc-bela-container?

Hey, so I'm trying to use the xc-bela-container repo here: https://github.com/ebai101/xc-bela-container

I've followed the steps for configuring and the project is built successfully and copied over to my bela, but when I try to run the program I get a missing lib:

root@bela:~# ./sinetone 
./sinetone: error while loading shared libraries: libseasocks.so.1.4.2: cannot open shared object file: No such file or directory

This may be helpful (I think):

root@bela:~# ldd sinetone 
        linux-vdso.so.1 (0xbee01000)
        libcobalt.so.2 => /usr/xenomai/lib/libcobalt.so.2 (0xb6f5c000)
        libmodechk.so.0 => /usr/xenomai/lib/libmodechk.so.0 (0xb6f4a000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6f26000)
        librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6f10000)
        libprussdrv.so => /usr/local/lib/libprussdrv.so (0xb6efd000)
        libasound.so.2 => /usr/lib/arm-linux-gnueabihf/libasound.so.2 (0xb6e48000)
        libseasocks.so.1.4.2 => not found
        libNE10.so.10 => /usr/lib/libNE10.so.10 (0xb6e09000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6df6000)
        libpd.so.1 => /usr/local/lib/libpd.so.1 (0xb6d40000)
        libatomic.so.1 => /usr/lib/arm-linux-gnueabihf/libatomic.so.1 (0xb6d2b000)
        libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6c1f000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6ba7000)
        libgcc_s.so.1 => /usr/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc_s.so.1 (0xb6b7e000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6a90000)
        /lib/ld-linux-armhf.so.3 (0xb6f82000)

Did a little bit more research comparing a built project, looks like there's a version mismatch on the provided container. Doing a rebuild of the docker image following this guide: https://github.com/ebai101/xc-bela-container#building-the-image (using the headers provided by the bela board) fixed the version mismatch. The boilerplate also needed to be updated so that that libbela.a was used instead of libbelafull.a (was it renamed?)

Example project is running now though!

@ebai101 ?

For my part I can say that libbelafull was never a part of the official Bela repo (see here) and if you need it you may need to add something to CustomMakefileTop.in and/or CustomMakefileBottom.in on the board.

I also recently learned that it's not a good idea to have "regular" C++ classes exposed across a shared library, as different compilers (or different versions of the same compiler) may get confused (see here), so a lot of this stuff is working out of coincidence (or at least luck) at the moment.