Use a dynamic library with OF

Hello,

I am using openFrameworks for a project together with Bass audio library (www.un4seen.com/). I have successfully compile and run my code on windows. Now I am trying to do the same on Raspberry pi 3, so I download the ARM linux library of Bass (http://www.un4seen.com/forum/?topic=13804) called libbass.so and I tried to compiled my code. I added this line to the config.make

USER_LIBS=/usr/lib/libbass.so

and I copied the libbass.so to the /usr/lib folder. The code compiles but when I run it i get this error:
“error while loading shared libraries: libbass.so: cannot open shared object file: No such file or directory”

I have tried different folders without success. Any thoughts?

Thanks,

Yiannis

Hey @yiannis,

Did you figure this out in the end? Struggling to do the same thing S:

Yes,
What I did was:

  1. Add this to config.make
    USER_LIBS = libbass.so

  2. Copy the libbass.so (from the hardfp folder) to usr/local/lib

  3. Add a “libbass.conf” file with only this line
    /usr/local/lib
    inside the “/etc/ld.so.conf.d/” folder.

  4. Run the “sudo ldconfig”

  5. Add the following line to /home/pi/.bashrc file
    export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}

6.Reboot

The only problem is that I have to run export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} again sometimes

Yiannis

1 Like