[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] some problem while linking
From: |
Martin Jansche |
Subject: |
Re: [Help-gsl] some problem while linking |
Date: |
Wed, 27 Sep 2006 16:58:14 -0400 |
On 9/27/06, boufflet <address@hidden> wrote:
address@hidden ~]$ gcc gsl_try.c -o gsl_try
/tmp/ccgTr3Jx.o(.text+0x24): In function `main':
gsl_try.c: undefined reference to `gsl_matrix_alloc'
collect2: ld a retourné 1 code d'état d'exécution
Since you're calling a linker here, you need to tell it to link
against the GSL library. An easy way to do this is:
gcc -o gsl_try gsl_try.c `gsl-config --cflags --libs`
We get no error while using the '-c' option as:
address@hidden ~]$ gcc -c gsl_try.c
You don't get a linker error here because you're only invoking the
compiler, not the linker.
HTH,
-- mj