On Fri, Oct 17, 2008 at 8:04 PM, Luis Borda de Agua <[EMAIL PROTECTED]> 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


_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl

Reply via email to