This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Re: undefined reference
- From: Martin Jansche <jansche at ling dot ohio-state dot edu>
- To: <gsl-discuss at sources dot redhat dot com>
- Date: Mon, 22 Sep 2003 14:52:35 -0400 (EDT)
- Subject: Re: Re: undefined reference
- Reply-to: Martin Jansche <jansche at acm dot org>
On Mon, 22 Sep 2003, Cheng Xing wrote:
> Well, I input gsl-config --lib, and get
> -L/usr/local/lib -lgsl -lgslcblas -lm
So use precisely that.
> So is that ok to compile with 'gcc filename -lgsl -lgslcblas -lm'?
You just proved to yourself that it's not OK. You probably need a -L
or -R option for your linker. Why don't you use `gsl-config --libs`
or $(gsl-config --libs) on your command line? As in "gcc $(gsl-config
--cflags) myfile.c $(gsl-config --libs)".
> I did compile successfully this time, but got another warning message
> when run the file a.out. It said:
> a.out: error while loading shared libraries: libgsl.so.0 : cannot open
> shared object file: No such file or directory.
> But I did find this file in my usr/local/lib
And that's your dynamic linker telling you that /usr/local/lib is not
in your dynamic library path. Read up on configuring /etc/ld.so.conf
or setting LD_LIBRARY_PATH.
- mj