[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] GSL problem
From: |
William Oquendo |
Subject: |
Re: [Help-gsl] GSL problem |
Date: |
Mon, 1 Jan 2018 10:25:20 -0500 |
Hi, that is a linker problem. You need to link with the gsl library. Add
the following flag to your compilation command
-lgsl
sometimes I also need to add
-lgslcblas
On Mon, Jan 1, 2018 at 10:06 AM, amin izadi <address@hidden> wrote:
> Hello
> I want to use GSL for my project.
> I downloaded the version 2.4 from your site and use these commands
> according to install file
> sudo su
> ./configure
> make
> make check
> make install
> ----------------------------------------------------------
> the file gsl exists in "/usr/local/include" .
> ----------------------------------------------------------
> but when I want to compile this code by "make":
> #include <stdio.h>
> #include <gsl/gsl_sf_bessel.h>
> int
> main (void)
> {
> double x = 5.0;
> double y = gsl_sf_bessel_J0 (x);
> printf ("J0(%g) = %.18e\n", x, y);
> return 0;
> }
> this message appears :
> g++ bessel_func.cpp -o bessel_func
> /tmp/ccZymBuK.o: In function `main':
> bessel_func.cpp:(.text+0x23): undefined reference to `gsl_sf_bessel_J0'
> collect2: error: ld returned 1 exit status
> <builtin>: recipe for target 'bessel_func' failed
> make: *** [bessel_func] Error 1
>
> ------------------------------------------------------------
> ----------------------
> I use ubuntu 16.0.4 64 bit and g++
>
> I hope you have enough time to answer me.
> Thanks in advance.
> Best regards.
>
--
Best regards / Cordialmente,
William-Fernando Oquendo
--------------------------
Este correo puede carecer de tildes o eñes debido al teclado.