[linux-audio-dev] Compiling with libsndfile

Rohan Parkes rparkes at email.com
Wed Apr 9 11:20:00 UTC 2003


Thanks for your reply, Erik.

I see now that there is some info about using pkg-config in the
documentation, but I hadn't understood its significance, being fairly
new to Linux development.

What I have is a simple test app that just opens an audio file and
prints out the properties.

I'm compiling it with 

gcc test.c -o test `pkg-config --cflags --libs sndfile`

But I always get the result

./test: error while loading shared libraries: libsndfile.so.1: cannot
open shared object file: No such file or directory.

The headers and libraries referenced by pkg-config all seem to be in the
right place.

I'm presumably doing something wrong, but can't see what it is.

Rohan Parkes
Melbourne
Australia


On Tue, 2003-04-08 at 18:18, Erik de Castro Lopo wrote:
> On 08 Apr 2003 15:51:11 +1000
> Rohan Parkes <rparkes at email.com> wrote:
> 
> > 	
> > gcc `sndfile-config --libs` file1.o file2.o -o program.
> 
> Thats for the old version. Nowadays (in fact for the last 15 months) you 
> do:
> 
>      gcc `pkg-config --libs sndfile` file1.o file2.o -o program
> 
> Similarly, for compiling a C file to an object:
> 
>      gcc `pkg-config --cflags sndfile` -c file.c
> 
> pkg-config is now the standard way of doing things like this.
> 
> Erik (the author :-))
> -- 
> +-----------------------------------------------------------+
>   Erik de Castro Lopo  nospam at mega-nerd.com (Yes it's valid)
> +-----------------------------------------------------------+
> "It's far too easy to make fun of Microsoft products, but it takes a 
> real man to make them work, and a god to make them do anything useful"
>   -- Anonymous





More information about the Linux-audio-dev mailing list