[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] Compile C++ with GSL
From: |
Hisham Kotry |
Subject: |
Re: [Help-gsl] Compile C++ with GSL |
Date: |
Sat, 19 Mar 2005 01:49:06 +0200 |
This is not a gsl specific question, just add -lstdc++ to link against
the standard C++ library, or use g++ instead of gcc; and yes you have
to explicity state what libraries the compiler should link against.
Cheers,
Kotry
On Fri, 18 Mar 2005 18:03:14 +0100, Thomas Bisig <address@hidden> wrote:
> Hi list
>
> I'd like to include the GSL into a single C++ file test.cpp and compile
> it. What do I have to do?
>
> I have a file with the single allocation of a matrix m like
>
> gsl_matrix * m = gsl_matrix_alloc (4, 4);
>
> I compile with (-lgslcblas is dispensable)
>
> gcc test.cpp -lgsl -lm -lgslcblas
>
> but I get an error
>
> ld: Undefined symbols:
> ___gxx_personality_v0
>
> The documentation says that one should be able to simply include the
> libraries into a C++ file and it should work. Where's the mistake?
>
> Thanks again
>
> thomas
>
> Ps: A not so GSL related question: I don't understand why I have to add
> -lgsl and so on when I want to compile. I include the libraries in the
> file so the compiler should know what to link!? Or do I have to say the
> gcc explicitly that I want to link to GSL and cBLAS?
>
> (Don't think I don't read the mail archives; I'm a little bit a newbie)
>
> _______________________________________________
> Help-gsl mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-gsl
>
--
Blessed are they who can laugh at themselves, for they shall never
cease to be amused.