bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gsl] unable to use gsl in MAC OS X


From: Oliver Jennrich
Subject: Re: [Bug-gsl] unable to use gsl in MAC OS X
Date: Fri, 17 Oct 2008 23:32:42 +0200

On Fri, Oct 17, 2008 at 8:04 PM, Luis Borda de Agua <address@hidden> wrote:

> - This was the error message:
>
> Undefined symbols:
>  "_gsl_sf_bessel_J0", referenced from:
>      _main in ccnvBbbv.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
>
> __________
>
> I realize that mac ports in fact installed the gsd in the directory
> /opt/local/include
> so I also tried
>
> $ gcc -Wall -I/opt/local/include  asd.c
>
> but I got exactly the same error message. I then moved the gsl library to
> /usr/local/include
> and I got the error message described above.

Firstly, you need to tell gcc that you actually want to link with the
gsl. You do that with '-lgsl'  (minus ell, *not* capital aye).
secondly, you need to tell gcc where to find the libraries. In your
case this is done via -L/opt/local/lib

So the complete command line looks like that:

gcc  -o asd asd.c -Wall -I/opt/local/include -L/opt/local/lib -lgsl

-- 
Space -- the final frontier




reply via email to

[Prev in Thread] Current Thread [Next in Thread]