This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: unable to compile example program;
On Wed, 2002-08-14 at 09:31, Y. U. Sasidhar wrote:
> 1. I am trying compile the example program:
[*SNIP*]
> gcc gsl.c -o gsl
>
> and getting the error:
> -----------------------------------------
> undefined reference to `gsl_sf_bessel_J0'
> collect2: ld returned 1 exit status
> --------------------------------------------
Hi Sasidhar,
This is a link-time (ld) error, not a header problem. You need to
provide the libraries containing the code declared in the header(s)
using something like:
gcc gsl.c -o gsl -lgsl -lgslcblas
which, on my RH 7.3 system, works fine with your example problem:
[edhill@XXX ~]$ ./gsl
J0(5) = -1.775967713143382920e-01
[edhill@XXX ~]$
hth,
Ed
--
Edward H. Hill III, PhD
Post-Doctoral Researcher | Email: ed@eh3.com, ehill@mines.edu
Division of ESE | URLs: http://www.eh3.com
Colorado School of Mines | http://cesep.mines.edu/people/edhill.php
Golden, CO 80401 | Phone: 303-273-3483 Fax: 303-273-3311