[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] undefined reference problem with GSL functions
From: |
Thomas Spuhler |
Subject: |
Re: [Help-gsl] undefined reference problem with GSL functions |
Date: |
Tue, 26 Jul 2005 17:10:23 -0700 |
User-agent: |
KMail/1.7.2 |
You may use a make file with this content.
It make the compilation simpler
GSLLIBS = -L/usr/local/lib -lgsl -lgslcblas
GSLINCS = -I/usr/local/include
# space seperated list of source files in program
SOURCES = source.cpp
# change testProgram.exe to the name you wish your
# executable program to be
outputbinary: $(SOURCES)
g++ -o $@ $(GSLINCS) $(GSLLIBS) $(SOURCES)
Tom
On Tuesday 26 July 2005 03:40 pm, Mike Smith wrote:
> I found it's fine if I do the following (as suggested
> by the manual)
>
> gcc -Wall -I/usr/local/include/gsl -c test.c;
> gcc -L/usr/local/lib/ test.o -lgsl -lgslcblas -lm
>
> Or equivalently do the following
> gcc -L/usr/local/lib/ test.c -lgsl -lgslcblas -lm
>
> Thanks for your attention.
>
> --Mike
>
> --- Mike Smith <address@hidden> wrote:
> > Hello, All
> >
> > I tried a very simple example on the gsl reference
> > manual to test the GSL installed in my Cygwin. The
> > program is the following:
> >
> > #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;
> > }
> >
> > When I do
> >
> > gcc -Wall -L/usr/local/include/gsl test.c -o test ,
> >
> > the following error will be reported:
> > ..../Temp/ccRVEv5H.o:test.c:(.text+0x3a): undefined
> > reference to `_gsl_sf_bessel_J0'
> >
> > The undefined reference problem is persistent
> > whenever
> > I try to use any GSL functions.
> >
> > I installed gsl in the default directory and "make
> > check" works fine.
> >
> > Does anybody know what happens?
> >
> > Thanks a lot,
> >
> > --Mike
> >
> >
> >
> > ____________________________________________________
> > Start your day with Yahoo! - make it your home page
> > http://www.yahoo.com/r/hs
> >
> >
> >
> > _______________________________________________
> > Help-gsl mailing list
> > address@hidden
> > http://lists.gnu.org/mailman/listinfo/help-gsl
>
> ____________________________________________________
> Start your day with Yahoo! - make it your home page
> http://www.yahoo.com/r/hs
>
>
>
> _______________________________________________
> Help-gsl mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-gsl
pgpnRSpnEMpfS.pgp
Description: PGP signature