libsoundio icon indicating copy to clipboard operation
libsoundio copied to clipboard

Can't link to libsoundio.so1 correctly

Open 0xfede7c8 opened this issue 6 years ago • 2 comments

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)

0xfede7c8 avatar Oct 01 '18 03:10 0xfede7c8

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.

Suhail avatar Jan 10 '20 16:01 Suhail

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.

aaronabebe avatar Jun 20 '21 19:06 aaronabebe