undefined reference

cx101 cx101@ohm.york.ac.uk
Mon Sep 22 18:13:00 GMT 2003


Hi guys,

I never compiled a programme successfully after I installed GSL 1.4. I 
was always told undefined reference to some head files. I even got the
warning message after run the following simple programme from the manual
of GSL:

#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;
}

When compiling, I was told:
/tmp/cc807SzQ.o(.text+0x28): In function 'main':
:undefined reference to 'gsl_sf_bessel_J0'
collect2: ld return 1 exit status

My gcc is 3.2.3, system is Mandrake 9.1.
I know it is a very stupid question. I am a rookie for linux.

Cheng



More information about the Gsl-discuss mailing list