[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Undefined reference to `gsl_spmatrix_uchar_norm1'
From: |
Håkon Hægland |
Subject: |
Undefined reference to `gsl_spmatrix_uchar_norm1' |
Date: |
Fri, 25 Jun 2021 17:45:47 +0200 |
I am on Ubuntu 21.04, using GSL 2.7. Here is my test program norm.c :
#include <stdio.h>
#include <gsl/gsl_spmatrix.h>
int
main()
{
gsl_spmatrix_uchar *A = gsl_spmatrix_uchar_alloc(2, 2);
gsl_spmatrix_uchar_set(A, 0, 0, 1);
gsl_spmatrix_uchar_set(A, 0, 1, 2);
gsl_spmatrix_uchar_set(A, 1, 0, 3);
gsl_spmatrix_uchar_set(A, 1, 1, 4);
double norm = gsl_spmatrix_uchar_norm1(A);
printf("norm = %g\n", norm);
gsl_spmatrix_uchar_free(A);
return 0;
}
When I compile this I get an error message from the linker:
$ gcc -Wall -I/opt/gsl/gsl-2.7/include -c norm.c
$ gcc -L/opt/gsl/gsl-2.7/lib -o norm norm.o -lgsl -lgslcblas -lm
/bin/ld: norm.o: in function `main':
norm.c:(.text+0x93): undefined reference to `gsl_spmatrix_uchar_norm1'
collect2: error: ld returned 1 exit status
Best regards,
Håkon Hægland
- Undefined reference to `gsl_spmatrix_uchar_norm1',
Håkon Hægland <=