[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] Cannot compile example.c
From: |
Jochen Küpper |
Subject: |
Re: [Help-gsl] Cannot compile example.c |
Date: |
Thu, 08 Jun 2006 11:37:49 +0200 |
César Asensio <address@hidden> writes:
> The command used for compilation is simply
>
> gcc example.c
>
> and the error message is
>
> /cygdrive/c/temp/ccvkPjgO.o:example.c:(.text+0x3a): undefined reference to
> `_gsl_sf_bessel_J0'
> collect2: ld returned 1 exit status
>
> Someone can help me?
How about reading the manual?
,----[ (info "(gsl-ref)Linking programs with the library") ]
| The library is installed as a single file, `libgsl.a'. A shared
| version of the library `libgsl.so' is also installed on systems that
| support shared libraries. The default location of these files is
| `/usr/local/lib'. If this directory is not on the standard search path
| of your linker you will also need to provide its location as a command
| line flag.
|
| To link against the library you need to specify both the main
| library and a supporting CBLAS library, which provides standard basic
| linear algebra subroutines. A suitable CBLAS implementation is
| provided in the library `libgslcblas.a' if your system does not provide
| one. The following example shows how to link an application with the
| library,
|
| $ gcc -L/usr/local/lib example.o -lgsl -lgslcblas -lm
|
| The default library path for `gcc' searches `/usr/local/lib'
| automatically so the `-L' option can be omitted when GSL is installed
| in its default location.
`----
Greetings,
Jochen
--
Einigkeit und Recht und Freiheit http://www.Jochen-Kuepper.de
Liberté, Égalité, Fraternité GnuPG key: CC1B0B4D
(Part 3 you find in my messages before fall 2003.)