[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] Issues with GSL, undefined reference

From: Niftitech
Subject: [Help-gsl] Issues with GSL, undefined reference
Date: Thu, 5 May 2016 13:22:37 +0200


I’m struggling with GSL, I’m on Ubuntu 14.04 and have just installed GSL. 
I downloaded the latest GSL release, and ran ./configure in the extracted 
folder, then sudo make, and after that sudo make install.
Everything seems to have worked fine during the installation.

I’ve tried some basic examples from the documentation. The first example from 
this page works great.

But this example does not work. I get the following error:
gcc main.c -o main -lgsl -lgslcblas -lm
/tmp/cclZjB9J.o: I funktionen "main":
main.c:(.text+0xe): undefined reference to `gsl_interp2d_bilinear'
main.c:(.text+0x88): undefined reference to `gsl_spline2d_alloc'
main.c:(.text+0xbc): undefined reference to `gsl_spline2d_set'
main.c:(.text+0xde): undefined reference to `gsl_spline2d_set'
main.c:(.text+0x10e): undefined reference to `gsl_spline2d_set'
main.c:(.text+0x130): undefined reference to `gsl_spline2d_set'
main.c:(.text+0x156): undefined reference to `gsl_spline2d_init'
main.c:(.text+0x26b): undefined reference to `gsl_spline2d_eval'
main.c:(.text+0x308): undefined reference to `gsl_spline2d_free'
collect2: error: ld returned 1 exit status

So I googled for a while, found another way to reference the libraries needed:
gcc -o main main.c `gsl-config --cflags --libs`
address@hidden:~/Skrivbord/gsl-test$ ./main
./main: error while loading shared libraries: cannot open shared 
object file: No such file or directory

But as you can see that did not work either.
I’d like to be able to compile the whole program into an executable file, so 
I’d rather link the libraries.

I’d be really happy for your’e help.

Kind regards, 
Simon Månsson

reply via email to

[Prev in Thread] Current Thread [Next in Thread]