Error while loading shared libraries

Hi, Mike.

I haven’t tried using it on RasPi myself yet, but this sort of thing happens when the dynamic linker can’t find a library that the executable needs. In this case, the startSystem program needs liblegato, and liblegato is not anywhere that the dynamic linker is looking for it.

The first thing to check is that liblegato.so is properly installed on your target. If it’s not installed in one of the standard places that the linker looks for libraries (like /lib or /usr/lib), then you need to tell the linker where to find it. There are lots of ways to do that. One that’s good for troubleshooting is adding the directory path to the LD_LIBRARY_PATH environment variable

export LD_LIBRARY_PATH=/mnt/legato/system/lib

Another (more persistent) way is to add the library to your linker’s cache. To do this,

  1. open up /etc/ld.so.conf (in an editor using sudo) and add a line containing the path to the directory containing the library

  2. run ‘sudo ldconfig’

NOTE: You can check where the linker is looking using strace.

sudo strace -f /mnt/legato/start

You’ll see it trying (and failing) to open liblegato.so in a bunch of different directories.

I hope this helps.

–Jen