The computer is refusing to run programs including GSL functions, despite the program compiling successfully. For example, consider the following program given as an example on the GSL website:
// Test program for GSL RNG
#include <stdio.h>
#include <gsl/gsl_rng.h>
int main (void)
{
const gsl_rng_type * T;
gsl_rng * r;
int i, n = 10;
gsl_rng_env_setup();
T = gsl_rng_default;
r = gsl_rng_alloc (T);
for (i = 0; i < n; i++)
{
double u = gsl_rng_uniform (r);
printf ("%.5f\n", u);
}
gsl_rng_free (r);
return 0;
}
This compiles, but then gives the following error during execution:
/tmp/ccPWUHlO.o: dans la fonction « main »:
GSL_rng_test.cc:(.text+0x10): référence indéfinie vers « gsl_rng_env_setup »
GSL_rng_test.cc:(.text+0x17): référence indéfinie vers « gsl_rng_default »
GSL_rng_test.cc:(.text+0x27): référence indéfinie vers « gsl_rng_alloc »
GSL_rng_test.cc:(.text+0x46): référence indéfinie vers « gsl_rng_uniform »
GSL_rng_test.cc:(.text+0x7d): référence indéfinie vers « gsl_rng_free »
collect2: erreur: ld a retourné 1 code d'état d'exécution
Sorry, it's in French, but I think you will understand the gist. GSL is installed and I have checked for the existence of the header file myself. Can someone help?