[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gsl] linker error
From: |
César Cárdenas |
Subject: |
[Help-gsl] linker error |
Date: |
Fri, 7 May 2004 16:55:58 +0200 |
Dear all:
I am doing the following simple example statistics program:
*********************************
#include <stdio.h>
#include <gsl/gsl_statistics.h>
int main (void)
{
double data[5] = {17.5, 18.1, 16.5, 18.3, 12.6};
double mean, variance, largest, smallest;
mean = gsl_statistics_mean (data, 1, 5);
variance = gsl_statistics_variance (data, 1, 5);
largest = gsl_statistics_max (data, 1, 5);
smallest = gsl_statistics_min (data, 1, 5);
printf ("The dataset is %g, %g, %g, %g, %g\n", data[0], data[1], data[2],
data[3], data[4]);
printf ("The sample mean is %g\n", mean);
printf ("The sample variance is %g\n", variance);
printf ("The largest value is %g\n", largest);
printf ("The smallest value is %g\n", smallest);
return 0;
}
**********************************
The compiling process messages are:
[Linker error] undefined reference to 'gsl_statistics_...'
for each function "gsl_..." in the program.
I already verified including libraries and I believe the problem is on *.a
or *.o or *.lib files but when extracted "gsl-1.4.tar.gzip" it does not
appear any *.a or *.o or *.lib file...
I really appreciate any help for compiling and running this example, have
a nice weekend.
César Cárdenas