linking problems

Paul Brossier piem at altern.org
Wed Mar 8 07:33:34 CET 2006


Hello,

On Wed, Mar 08, 2006 at 02:13:29AM +0100, Aylon Eduard wrote:
> Hello there,
> 
> I have tried to subscribe to the list by emailing to
> aubio-subscribe at piem.org but I got a Failed Mail delivery reply. So I have
> decided to send an email directly to the list to get some help.

Ouch, sorry about that, i will try to figure out. 

> I am trying to use the aubio onsetdetection capabilities, but some how it
> fails to link to sndfile when compiling. I get undefined references to the
> functions which use sndfile such as new_aubio_sndfile_ro,
> aubio_sndfile_samplerate, et cetera.
> Should I specify any flags when configuring/compiling aubio?
> 
> For instance if I try to compile the following simple example:
> 

I would include <aubio/aubioext.h>, since the function used is in
aubioext:

---
#include <aubio/aubio.h>
#include <aubio/aubioext.h>

int main( int argc, char** argv )
{
        aubio_sndfile_t *foo = new_aubio_sndfile_ro( argv[1] );
        return 1;
}
---

> with g++ -laubio -lsndfile foo.cxx -o a.out

similarly, you need to link against aubioext:

g++ -laubio -laubioext -lsndfile foo.cxx -o a.out

should resolve all linking references.

> Should I link against other libraries as well?

Here sndfile is optional, since aubioext is linked against. It seems
best practice is to mention all the librairies you need.

I hope this helps. 

Best, Paul

> I am not that experience programmer, so my appologises before hand if I am
> asking something very obvious.
> Any help would be much appreciated.
> 
> 
> Thanks,
> 
> eduard


-- 
To unsubscribe, send mail to aubio-unsubscribe at piem.org.



More information about the aubio-user mailing list