This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: undefined reference


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]