libsoundio
libsoundio copied to clipboard
Can't link to libsoundio.so1 correctly
I'm very new with the library, maybe I'm making some basic mistake.
I'm trying to get the first example working. I built libsoundio with
cmake ..
make
sudo make install
Then built the example with
gcc test.c -o test -lm -lsoundio
But when I run it it does not find the shared lib:
./test_audio: error while loading shared libraries: libsoundio.so.1: cannot open shared object file: No such file or directory
Any advice?
P.S: It would be nice to have a basic build line for the examples on the documentation (did not found one)
After sudo make install
, I got things working via:
'libraries': ['-lsoundio'], (same as -l libsoundio
I believe)
#include <soundio/soundio.h>
in my cpp file
If it's not working, I'd try sudo make install-ing and noticing the paths it writes to.
Hi!
I had the same problem, and it is due to lsoundio
not being in the ldconfig path.
While the build process was correct and it copied everything to the correct directory ldconfig did not know about its location.
You can use ldconfig -p
to see all libraries ldconfig currently knows about.
You can add the local path manually to ldconfig with vim:
sudo vim /etc/ld.so.conf.d/local.conf
and then adding /usr/local/lib
as first line.
Afterwards do a sudo ldconfig
to update the paths.