help-gsl
[Top][All Lists]
Advanced

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

[Help-gsl] unable to compile program with gsl in a MAC OS X


From: Luis Borda de Agua
Subject: [Help-gsl] unable to compile program with gsl in a MAC OS X
Date: Fri, 17 Oct 2008 11:59:16 -0700



I installed gsl using mac ports. unfortunately when I tried to run one of your examples, it didn't work. Here are the details:

- gsl version 1.11

- Mac OS X 10.5.5 (Leopard); processor 2.5 GHz intel Core 2 Duo

- gcc (lrwxr-xr-x 1 root wheel 7 Mar 14 2008 gcc -> gcc-4.0)

This was the program I used (one of your examples):

#include <stdio.h>
#include <gsl/gsl_sf_bessel.h>

int
main (void)
{
     double x = 5.0;
     double y = gsl_sf_bessel_J0 (x);
     printf ("J0(%g) = %.18e\n", x, y);
     return 0;
}

- This is how I try to compile it

$ gcc -Wall -I/usr/local/include  asd.c

("asd.c" being the name of file with the code)

- 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.

I would appreciate if someone could help me with this.
Yours,

Luís Borda de Água
Dept. of Ecology and Evolutionary Biology
621 Charles E. Young Drive
University of California
LOS ANGELES CA 90095
Phone: +1 (310) 206 2801
Fax: +1 (310) 206 3907
____________________________________
Luís Borda de Água
Dept. of Ecology and Evolutionary Biology
621 Charles E. Young Drive
University of California
LOS ANGELES CA 90095
Phone: +1 (310) 206 2801
Fax: +1 (310) 206 3907









reply via email to

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