This is the mail archive of the
gsl-discuss@sourceware.cygnus.com
mailing list for the GSL project.
Linking errors
- To: gsl-discuss at sourceware dot cygnus dot com
- Subject: Linking errors
- From: J Andres Christen <jac at matmor dot unam dot mx>
- Date: Tue, 30 May 2000 17:18:58 -0500
- Organization: Instituto de Matematicas, Campus Morelia, UNAM
Hi,
I'm traying to use the vector and matrix functions of gsl_0.5 but I
can't link the example program:
#include <stdio.h>
#include <gsl_matrix.h>
int main ()
{
int i, j;
gsl_matrix *m = gsl_matrix_alloc(10, 3);
for (i = 0; i < 10; i++)
for (j = 0; j < 3; j++)
gsl_matrix_set (m, i, j, 0.23 + 100*i + j);
for (i = 0; i < 100; i++)
for (j = 0; j < 3; j++)
printf("m(%d,%d) = %g\n", i, j, gsl_matrix_get (m, i, j));
}
with
gcc -I/usr/local/include/gsl -L/usr/local/lib/gsl -O -o sim sim.o
-lgslsys -lgslerr -lgslieeeutils -lgsltest -lutils -lgslblas
-lgslblascblas -lgslblasnative -lgsleigen -lgsllinalg -lgslrandist
-lgslrng -lgslspecfunc -lgslblock -lgslvector -lgslmatrix -lgsldht
-lgslfft -lgslhistogram -lgslintegration -lgslinterpolation -lgslmin
-lgslmonte -lgslmultiroots -lgslodeiv -lgslpoly -lgslroots -lgslsi
(I've included all the libraries.), I get error messages like:
/usr/local/lib/gsl/libgslmatrix.a(matrix.o): In function
`gsl_matrix_char_set':
/usr/local/gsl-0.5/matrix/matrix_source.c:26: undefined reference to
`gsl_check_range'
/usr/local/gsl-0.5/matrix/matrix_source.c:30: undefined reference to
`gsl_error'/usr/local/gsl-0.5/matrix/matrix_source.c:34: undefined
reference to `gsl_error'
What am I doing wrong?
How could I know what libraries to use? It is not clear to me from
reading the manual.
Thanks,
Andrés.
--
VERIFIQUE NUESTRA NUEVA DIRECCION, TELEFONOS Y CORREO-E.
PLEASE NOTE OUR NEW ADDRESS, PHONE NUMBERS AND E-MAIL.
Dr J Andrés Christen Tel: 32-776 ext. (red-unam)
Instituto de Matematicas Fax: 32-732 ext. (red-unam)
Campus Morelia, UNAM Local DF: 562-32-776 o 32-732
AP 61-3 (Xangari) Local Morelia: 320-05-65 (fax 66)
58089, Morelia, Mich. Otros: +52-562-32-776 o 32-732
MEXICO e-mail: jac@matmor.unam.mx